summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/concurrency.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/syscalls/linux/concurrency.cc')
-rw-r--r--test/syscalls/linux/concurrency.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/syscalls/linux/concurrency.cc b/test/syscalls/linux/concurrency.cc
index 2c13b315c..f5a941ca8 100644
--- a/test/syscalls/linux/concurrency.cc
+++ b/test/syscalls/linux/concurrency.cc
@@ -72,8 +72,7 @@ TEST(ConcurrencyTest, MultiProcessMultithreaded) {
}
});
- pid_t child_pid;
- ASSERT_THAT(child_pid = fork(), SyscallSucceeds());
+ pid_t child_pid = fork();
if (child_pid == 0) {
// Busy wait without making any blocking syscalls.
auto end = absl::Now() + absl::Seconds(5);
@@ -81,6 +80,7 @@ TEST(ConcurrencyTest, MultiProcessMultithreaded) {
}
_exit(0);
}
+ ASSERT_THAT(child_pid, SyscallSucceeds());
absl::SleepFor(absl::Seconds(1));
@@ -99,13 +99,13 @@ TEST(ConcurrencyTest, MultiProcessMultithreaded) {
// never yields.
TEST(ConcurrencyTest, MultiProcessConcurrency) {
- pid_t child_pid;
- ASSERT_THAT(child_pid = fork(), SyscallSucceeds());
+ pid_t child_pid = fork();
if (child_pid == 0) {
while (true) {
}
__builtin_unreachable();
}
+ ASSERT_THAT(child_pid, SyscallSucceeds());
absl::SleepFor(absl::Seconds(5));