ethereumjs-monorepo icon indicating copy to clipboard operation
ethereumjs-monorepo copied to clipboard

Fix client `miner` tests

Open acolytec3 opened this issue 1 year ago • 1 comments

There are three skipped tests in packages/client/test/miner/miner.spec.ts that depend on a complicated interaction of timeouts in order to pass and they often timeout or have race condition errors when run in parallel with other tests (as happens with our current test runner -- vitest) and also in our CI. If we decide it's valuable to keep these tests, we should rework the test to use vi.useFakeTimers so we can control the flow of time and not depend on race conditions for the tests to pass.

acolytec3 avatar Jul 20 '23 19:07 acolytec3

One additional note is these tests only apply to the PoA/PoW miner functionality. In PoS networks, the miner class is completely unused and instead the pendingBlock class is used to construct blocks. So, that's one vote against even fixing these tests and maybe even a reason to deprecate the miner class as a whole since it's little used today and likely to only get lower and lower usage over time.

acolytec3 avatar Jul 20 '23 19:07 acolytec3