-
Notifications
You must be signed in to change notification settings - Fork 5.3k
test: simulated time block on sleep #10551
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
Changes from all commits
7d3b23e
6e6a025
9d9e104
4ee85a7
4767293
8f7ccb0
a661b60
b587221
c3c58c0
9a7261d
7d4ee46
bcfb1a3
b148b62
435b660
5649e70
4ac4a30
76ac2f5
57ad7c5
2d6aa6e
5576b7c
d3aa9c4
6a529a8
46325e4
a536cf2
27a68ca
8382a0b
9b0be70
a0b385e
5267e6d
c8ec0ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ class HeapShrinkerTest : public testing::Test { | |
| : api_(Api::createApiForTest(stats_, time_system_)), dispatcher_(*api_, time_system_) {} | ||
|
|
||
| void step() { | ||
| time_system_.sleep(std::chrono::milliseconds(10000)); | ||
| time_system_.advanceTimeAsync(std::chrono::milliseconds(10000)); | ||
| dispatcher_.run(Event::Dispatcher::RunType::NonBlock); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here - I assume the non-block is to give time for the callback to run. I guess I'm not sure where we'd advance and not run alarms, and I wonder how many of these cases are holdover from the differences not clearly being spelled out? Most of these tests are doing a "walk forward" and make sure my thing is called" check.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's no other thread in this test; the callbacks are run by the dispatcher_.run() call below. If we called sleep() here it would deadlock since no thread would be alive to run the callbacks. |
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.