Make the gput_allocator_retry_test *Fail test cases more reliable
by having each consumer thread pause for 1 msec between getting its memory and returning it. Logged failures for the NoRetryFail case suggest that on OS/X thread scheduling is such that without this delay it's possible not to experience a race condition failure within 10 seconds. Change: 123257296
This commit is contained in:
parent
55e8a9211e
commit
6e89233b74
@ -81,6 +81,9 @@ class GPUAllocatorRetryTest : public ::testing::Test {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Failures are more likely to occur if each consumer
|
||||
// delays for a while before returning the memory.
|
||||
Env::Default()->SleepForMicroseconds(500);
|
||||
++consumer_count_[i];
|
||||
for (int j = 0; j < cap_needed; ++j) {
|
||||
alloc_->DeallocateRaw(ptr);
|
||||
@ -141,9 +144,10 @@ TEST_F(GPUAllocatorRetryTest, RetrySuccess) {
|
||||
EXPECT_GT(consumer_count_[2], 0);
|
||||
}
|
||||
|
||||
/* Disabled due to flakiness. b/24738751
|
||||
// Verifies OutOfMemory failure when memory is slightly overcommitted
|
||||
// and retry is not allowed.
|
||||
// and retry is not allowed. Note that this test will fail, i.e. no
|
||||
// memory alloc failure will be detected, if it is run in a context that
|
||||
// does not permit real multi-threaded execution.
|
||||
TEST_F(GPUAllocatorRetryTest, NoRetryFail) {
|
||||
// Support up to 2 allocations simultaneously, waits up to 0 msec for
|
||||
// a chance to alloc.
|
||||
@ -162,7 +166,6 @@ TEST_F(GPUAllocatorRetryTest, NoRetryFail) {
|
||||
EXPECT_TRUE(has_failed_);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Verifies OutOfMemory failure when retry is allowed but memory capacity
|
||||
// is too low even for retry.
|
||||
|
Loading…
x
Reference in New Issue
Block a user