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

Deflake ScopeTest.WaitIdleFailure by increasing sleep time. #17859

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions runtime/src/iree/task/scope_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ TEST(ScopeTest, WaitIdleSuccess) {

// Spin up a thread to wait on the scope.
std::thread wait_thread([&]() {
// Note: if the thread takes longer to start than the sleep below, this
// will fail with a flake :(
EXPECT_FALSE(iree_task_scope_is_idle(&scope));
EXPECT_TRUE(iree_status_is_ok(
iree_task_scope_wait_idle(&scope, IREE_TIME_INFINITE_FUTURE)));
Expand All @@ -190,7 +192,7 @@ TEST(ScopeTest, WaitIdleSuccess) {

// Wait a moment for the thread to spin up.
// NOTE: this may flake. Need to see if there's a better way to do this.
std::this_thread::sleep_for(std::chrono::milliseconds(150));
std::this_thread::sleep_for(std::chrono::milliseconds(250));

// Complete the task.
iree_task_submission_t pending_submission;
Expand Down Expand Up @@ -222,6 +224,8 @@ TEST(ScopeTest, WaitIdleFailure) {

// Spin up a thread to wait on the scope.
std::thread wait_thread([&]() {
// Note: if the thread takes longer to start than the sleep below, this
// will fail with a flake :(
EXPECT_FALSE(iree_task_scope_is_idle(&scope));
EXPECT_TRUE(iree_status_is_ok(
iree_task_scope_wait_idle(&scope, IREE_TIME_INFINITE_FUTURE)));
Expand All @@ -230,7 +234,7 @@ TEST(ScopeTest, WaitIdleFailure) {

// Wait a moment for the thread to spin up.
// NOTE: this may flake. Need to see if there's a better way to do this.
std::this_thread::sleep_for(std::chrono::milliseconds(150));
std::this_thread::sleep_for(std::chrono::milliseconds(250));

// Set the failure state.
iree_task_scope_fail(
Expand Down
Loading