-
Notifications
You must be signed in to change notification settings - Fork 228
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
Remove nervosnetwork/faketime, replace cargo test by nextest-rs/nextest #3777
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval-exec
force-pushed
the
fix/mock-time
branch
from
December 29, 2022 05:08
fe05f28
to
2188817
Compare
eval-exec
changed the title
[WIP] remove nervosnetwork/faketime, use serial with static atomics to provide
[WIP] remove nervosnetwork/faketime, replace cargo test by nextest-rs/nextest
Dec 29, 2022
eval-exec
force-pushed
the
fix/mock-time
branch
14 times, most recently
from
December 29, 2022 08:56
464e587
to
4b08302
Compare
Try to make github ci action use
Trying to install an older version of |
eval-exec
force-pushed
the
fix/mock-time
branch
from
December 29, 2022 09:13
4b08302
to
3bd73e0
Compare
eval-exec
force-pushed
the
fix/mock-time
branch
9 times, most recently
from
December 29, 2022 14:01
0088c7c
to
61abbd9
Compare
eval-exec
force-pushed
the
fix/mock-time
branch
6 times, most recently
from
December 29, 2022 15:48
6a79801
to
27cf77b
Compare
eval-exec
changed the title
[WIP] remove nervosnetwork/faketime, replace cargo test by nextest-rs/nextest
Remove nervosnetwork/faketime, replace cargo test by nextest-rs/nextest
Dec 30, 2022
eval-exec
force-pushed
the
fix/mock-time
branch
2 times, most recently
from
January 10, 2023 01:44
4240ccc
to
4e9fa6f
Compare
Signed-off-by: Eval EXEC <execvy@gmail.com>
eval-exec
force-pushed
the
fix/mock-time
branch
from
January 10, 2023 01:50
4e9fa6f
to
deaee2a
Compare
zhangsoledad
approved these changes
Jan 12, 2023
bors r+ |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #3729
Problem Summary:
This PR want to remove nervosnetwork/faketime, and simply use static atomics and nextest to organize ckb's unit tests.
What is changed and how it works?
The
nervosnetwork/faketime
is complicated, and when we specified--test-threads=1
flag tocargo test
, thesethread_local
(https://github.com/nervosnetwork/faketime/blob/1ead0aba139f0893d04aa95c35e0179c3b4482c7/src/faketime.rs#L109-L115 ) behave like global variables, then some tests will fail.
The
cargo test
run all unit test in a single process, and many unit tests may run on a same thread. And there exists some faketime related test want to change the whole process's faketime by set current process's environment like this:ckb/chain/src/tests/block_assembler.rs
Line 135 in fafa37d
this may affect other non-faketime related unit tests.
Fortunately, there is nextest-rs/nextest which will run every unit function on single process, providing process-level isolation granularity.
What's Changed:
Related changes
util/systemtime
to provide real systemtime, and provide faketime whenenable_faketime
feature is enabledCheck List
Tests
Side effects
Release note