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:
Kevin Krakauer
2021-04-05 12:37:31 -07:00
committed by gVisor bot
parent e21a71bff1
commit e7b2023647
-8
View File
@@ -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 = {};