ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.1k stars 273 forks source link

test: update clock tests to run deterministically #6828

Closed divyesh87 closed 2 weeks ago

divyesh87 commented 1 month ago

Motivation

Clock tests at clock.test.ts keep failing from time to time due to edge cases arising from the use of Date.now This aims to fix that.

Description

This change overrides the system time before each test case to make the tests run deterministically.

Closes #6734

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 62.19%. Comparing base (95ce044) to head (10428a8). Report is 21 commits behind head on unstable.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## unstable #6828 +/- ## ============================================ - Coverage 62.21% 62.19% -0.02% ============================================ Files 571 571 Lines 60017 60021 +4 Branches 1975 1973 -2 ============================================ - Hits 37338 37333 -5 - Misses 22636 22645 +9 Partials 43 43 ```