mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
deflake semaphore test
There's no reason to actually increment the semaphore, it just introduces the chance of a race. PiperOrigin-RevId: 366851795
This commit is contained in:
committed by
gVisor bot
parent
e21a71bff1
commit
e7b2023647
@@ -234,14 +234,6 @@ TEST(SemaphoreTest, SemTimedOpBlock) {
|
||||
AutoSem sem(semget(IPC_PRIVATE, 1, 0600 | IPC_CREAT));
|
||||
ASSERT_THAT(sem.get(), SyscallSucceeds());
|
||||
|
||||
ScopedThread th([&sem] {
|
||||
absl::SleepFor(absl::Milliseconds(100));
|
||||
|
||||
struct sembuf buf = {};
|
||||
buf.sem_op = 1;
|
||||
ASSERT_THAT(RetryEINTR(semop)(sem.get(), &buf, 1), SyscallSucceeds());
|
||||
});
|
||||
|
||||
struct sembuf buf = {};
|
||||
buf.sem_op = -1;
|
||||
struct timespec timeout = {};
|
||||
|
||||
Reference in New Issue
Block a user