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

[idle term] fix on local resource idle time check #41206

Merged
merged 1 commit into from
Nov 16, 2023
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 src/ray/raylet/scheduling/local_resource_manager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ TEST_F(LocalResourceManagerTest, IdleResourceTimeTest) {

ASSERT_NE(idle_time, absl::nullopt);
ASSERT_NE(*idle_time, absl::InfinitePast());
auto dur = absl::ToInt64Seconds(absl::Now() - *idle_time);
// Adds a 100ms buffer time. The idle time counting does not always
// guarantee to be strictly longer than the sleep time.
auto dur = absl::ToInt64Seconds(absl::Now() - *idle_time + absl::Milliseconds(100));
ASSERT_GE(dur, 1);
}

Expand Down Expand Up @@ -264,7 +266,9 @@ TEST_F(LocalResourceManagerTest, IdleResourceTimeTest) {
// Test allocates same resource have the right idle time.
auto idle_time = manager->GetResourceIdleTime();
ASSERT_TRUE(idle_time.has_value());
ASSERT_GE(absl::Now() - *idle_time, absl::Seconds(1));
// Gives it 100ms buffer time. The idle time counting does not always
// guarantee that it is larger than 1 second after a 1 second sleep.
ASSERT_GE(absl::Now() - *idle_time, absl::Seconds(1) - absl::Milliseconds(100));
}

// Allocate the resource
Expand Down
Loading