Randomly wrong order of magnitude in balance tests
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- blockchain, testing-qa
Research direction
Start with test/integration/human-standard-token.js around line 143 and review the failing CI run across Node.js 16, 18, and 20. Trace the balance update through lib/index.js, especially updateBalances and _update, and determine whether the failure is caused by the test setup or token balance handling. Done means the cause is identified and the integration test reliably expects the correct balance.
Written by the indexing model from the issue text.
Description
This occurs randomly in CI, and has been for some time. I can not say I'm sure this was ever not happening:
# HumanStandardToken balance changes are emitted
eth_call
eth_call
eth_call
eth_blockNumber
eth_call
not ok 11 initial balance loaded from last test
---
operator: equal
expected: '8.9'
actual: '890'
at: TokenTracker.<anonymous> (/home/runner/work/eth-token-tracker/eth-token-tracker/test/integration/human-standard-token.js:143:16)
stack: |-
Error: initial balance loaded from last test
at Test.assert [as _assert] (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:312:48)
at Test.bound [as _assert] (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:95:17)
at Test.strictEqual (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:476:7)
at Test.bound [as equal] (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/tape/lib/test.js:95:17)
at TokenTracker.<anonymous> (/home/runner/work/eth-token-tracker/eth-token-tracker/test/integration/human-standard-token.js:143:16)
at safeApply (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/@metamask/safe-event-emitter/index.js:6:17)
at TokenTracker.emit (/home/runner/work/eth-token-tracker/eth-token-tracker/node_modules/@metamask/safe-event-emitter/index.js:54:13)
at TokenTracker._update (/home/runner/work/eth-token-tracker/eth-token-tracker/lib/index.js:106:10)
at TokenTracker.updateBalances (/home/runner/work/eth-token-tracker/eth-token-tracker/lib/index.js:62:12)
...
As can be seen in that CI run, the same test that fail in the Node.js 18 run passes on both 16 and 20. If retried, it will usually pass. Not currently clear if this is an actual bug or just an issue with the test setup.
Related
- #128
- Dominant language
- JavaScript
- Stars
- 81
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetaMask/eth-token-tracker
-
team-wallet-framework wf-security
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MetaMask/eth-token-tracker#150 ·
-
team-wallet-framework wf-project-standardization
Difficulty 3/5 1-2 days Newbie friendliness 35/100
MetaMask/eth-token-tracker#129 ·
-
team-wallet-framework wf-project-standardization
Difficulty 3/5 1-2 days Newbie friendliness 45/100
MetaMask/eth-token-tracker#128 ·
-
team-wallet-framework wf-project-standardization
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MetaMask/eth-token-tracker#127 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
All issues in MetaMask/eth-token-tracker
Similar issues
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vercel/ai#22796 · 2 comments ·
Maintainers usually reply within 1 day
-
good first issue needs-triage priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
melodic-software/claude-code-plugins#6982 · 1 comment ·
Maintainers usually reply within 1 day
-
chore v2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/servers#5115 ·
Maintainers usually reply within 1 day
-
beginner bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 85/100
philaconvalley/website#168 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day