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 node versions #3286

Merged
merged 3 commits into from
Mar 12, 2024
Merged

Fix node versions #3286

merged 3 commits into from
Mar 12, 2024

Conversation

jochem-brouwer
Copy link
Member

@jochem-brouwer jochem-brouwer commented Feb 15, 2024

Closes #3279

TODO

  • Fix node version tests
  • Remove node-versions job from being triggered on PRs
  • Restore the old CI jobs back (remove this commit: aabeb3f)

Note: the client test seems to rely upon the internal timing of the NodeJS timers. I think if we make this longer (I made it 100 times longer) then we are ok. (Although this raises the question if we should take a deeper look if we can improve this test)

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.60%. Comparing base (891ee51) to head (0175f87).

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.43% <ø> (ø)
blockchain 91.61% <ø> (ø)
client 84.86% <ø> (-0.03%) ⬇️
common 98.43% <ø> (ø)
devp2p 82.12% <ø> (ø)
ethash ∅ <ø> (∅)
evm ?
genesis 99.98% <ø> (ø)
rlp ?
statemanager 77.00% <ø> (ø)
trie 89.28% <ø> (-0.04%) ⬇️
tx 95.55% <ø> (ø)
util 89.19% <ø> (ø)
vm 79.85% <ø> (ø)
wallet 88.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@acolytec3
Copy link
Contributor

This test fails intermittently even on normal CI runs. I've thought about looking into this more but haven't had a chance. An ideal solution would be event based rather than timer based so we don't have these failures that just aren't guaranteed to work that well. Or explore using vitest's fakeTimers API to manually control the timers. I've done this in some ultralight tests that are dependent on timestamps to eliminate random test failures there.

@jochem-brouwer
Copy link
Member Author

Well, the weird thing is that it keeps failing the VM nightly tests, see: https://github.com/ethereumjs/ethereumjs-monorepo/actions/workflows/vm-nightly-test.yml

So this is not a random event.

I had it passing locally but it keeps failing on CI, so yes, I think we should go with your suggestion and make the test more robust. (I will not have time to address this today)

@holgerd77
Copy link
Member

Thanks for giving this a start! 🙏

@acolytec3
Copy link
Contributor

In looking further at this test, this looks like a prime candidate for moving from td to vitest.mock for mocking. At the same time we ought to be able to switch over to fakeTimers to make this work robustly. I will take a look tonight and/or this weekend as life allows.

@jochem-brouwer jochem-brouwer marked this pull request as ready for review March 12, 2024 15:27
Copy link
Member Author

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (cannot approve my own PR)

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@acolytec3 acolytec3 merged commit 20d088e into master Mar 12, 2024
36 checks passed
@holgerd77 holgerd77 deleted the fix-node-versions branch March 13, 2024 10:25
@@ -12,7 +12,8 @@ class FetcherTest extends Fetcher<any, any, any> {
return res
}
async request(_job: any, _peer: any) {
return
console.trace(_job)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure: is this console.trace() meant to stay here (is this only triggered in the failure case for debugging e.g.?)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Otherwise: cool 🤩 and congrats on the merge! 🙏)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node version tests fail
3 participants