Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Account Tracker API Usage should not make eth_call o..." flaky tests #27128

Open
hjetpoluru opened this issue Sep 13, 2024 · 1 comment
Open
Labels
flaky tests Sev2-normal Normal severity; minor loss of service or inconvenience. team-extension-platform type-bug

Comments

@hjetpoluru
Copy link
Contributor

hjetpoluru commented Sep 13, 2024

Ci failure reported on Sept 18
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/100857/workflows/2e16059a-2ea7-4041-a4d1-7bdb66bef8c8/jobs/3754928/tests

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/100098/workflows/719e41e8-7f60-4096-ac82-faeab6ca6b75/jobs/3726918/tests

Test scenario - Account Tracker API Usage should not make eth_call or eth_getBalance or eth_getBlockByNumber requests after the UI is closed
Test path - test/e2e/tests/api-usage/account-tracker-api-usage.spec.ts
Build - webpack
Browser - Chrome

An eth_getBlockByNumber or eth_call or eth_getBalance request has been made to infura after closing the UI
  (Ran on CircleCI Node 11 of 20, Job test-e2e-chrome-webpack)
AssertionError [ERR_ASSERTION]: An eth_getBlockByNumber or eth_call or eth_getBalance request has been made to infura after closing the UI
    at /home/circleci/project/test/e2e/tests/api-usage/account-tracker-api-usage.spec.ts:2:4721
    at async withFixtures (test/e2e/helpers.js:217:5)
    at async Context.<anonymous> (test/e2e/tests/api-usage/account-tracker-api-usage.spec.ts:2:3870)

      + expected - actual

      -false
      +true

image

Console log

Executing testcase: 'Account Tracker API Usage should not make eth_call or eth_getBalance or eth_getBlockByNumber requests after the UI is closed'

2024-09-12T15:58:24.703Z [driver] Called 'navigate' with arguments []
ServerMochaToBackground got a client connection
2024-09-12T15:58:33.244Z [driver] Called 'fill' with arguments ["#password","correct horse battery staple"]
2024-09-12T15:58:34.135Z [driver] Called 'press' with arguments ["#password",""]
2024-09-12T15:58:34.193Z [driver] Called 'assertElementNotPresent' with arguments ["[data-testid=\"unlock-page\"]"]
2024-09-12T15:58:37.209Z [driver] Called 'delay' with arguments [1600]
2024-09-12T15:58:38.810Z [driver] Called 'openNewURL' with arguments ["about:blank"]
2024-09-12T15:58:39.028Z [driver] Called 'delay' with arguments [20000]
Failure on testcase: 'Account Tracker API Usage should not make eth_call or eth_getBalance or eth_getBlockByNumber requests after the UI is closed', for more information see the artifacts tab in CI

AssertionError [ERR_ASSERTION]: An eth_getBlockByNumber or eth_call or eth_getBalance request has been made to infura after closing the UI

ServerMochaToBackground disconnected from client
manifest-flag-mocha-hooks.ts -- afterEach hook
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Mocha Tests" time="55.159" tests="2" failures="1">
  <testsuite name="Root Suite" timestamp="2024-09-12T15:58:04" tests="0" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Account Tracker API Usage" timestamp="2024-09-12T15:58:04" tests="2" file="/home/circleci/project/test/e2e/tests/api-usage/account-tracker-api-usage.spec.ts" time="55.158" failures="1">
    <testcase name="Account Tracker API Usage should not make eth_call or eth_getBalance requests before the UI is opened and should make those requests after the UI is opened" time="18.112" classname="should not make eth_call or eth_getBalance requests before the UI is opened and should make those requests after the UI is opened">
    </testcase>
    <testcase name="Account Tracker API Usage should not make eth_call or eth_getBalance or eth_getBlockByNumber requests after the UI is closed" time="37.023" classname="should not make eth_call or eth_getBalance or eth_getBlockByNumber requests after the UI is closed">
      <failure message="An eth_getBlockByNumber or eth_call or eth_getBalance request has been made to infura after closing the UI
  (Ran on CircleCI Node 11 of 20, Job test-e2e-chrome-webpack)" type="AssertionError"><![CDATA[AssertionError [ERR_ASSERTION]: An eth_getBlockByNumber or eth_call or eth_getBalance request has been made to infura after closing the UI
    at /home/circleci/project/test/e2e/tests/api-usage/account-tracker-api-usage.spec.ts:2:4721
    at async withFixtures (test/e2e/helpers.js:217:5)
    at async Context.<anonymous> (test/e2e/tests/api-usage/account-tracker-api-usage.spec.ts:2:3870)

      + expected - actual

      -false
      +true
      ]]></failure>
    </testcase>
  </testsuite>
</testsuites>
retry() received: Exited with code '1'
Error occurred while running tests on chrome: Error: Retry limit reached
Error: Exited with code '1'
    at runInShell (/home/circleci/project/development/lib/run-command.js:134:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (/home/circleci/project/test/e2e/run-all.js:268:7)

Exited with code exit status 1

@chloeYue
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky tests Sev2-normal Normal severity; minor loss of service or inconvenience. team-extension-platform type-bug
Projects
Status: To be fixed
Status: To be fixed
Development

No branches or pull requests

2 participants