summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Evan Brown <ezb@google.com>2024-03-06 13:40:51 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-03-06 13:41:59 -0800
commit53e6dae02bf0d9a5a1d304a3d637c083376b86a1 (patch)
tree00dd63ad547a0640a78c7b27e7032f79c9f0ba80 /absl
parent6f0bb2747d0a910de4a958eeeab2b9d615156382 (diff)
Fix flaky MSVC test failures by using longer slop time.
PiperOrigin-RevId: 613326708 Change-Id: I6e5ca195f208b8da0d21d70b5a035bfdc64f866d
Diffstat (limited to 'absl')
-rw-r--r--absl/synchronization/internal/per_thread_sem_test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/absl/synchronization/internal/per_thread_sem_test.cc b/absl/synchronization/internal/per_thread_sem_test.cc
index 24a6b548..c66bca84 100644
--- a/absl/synchronization/internal/per_thread_sem_test.cc
+++ b/absl/synchronization/internal/per_thread_sem_test.cc
@@ -159,7 +159,11 @@ TEST_F(PerThreadSemTest, Timeouts) {
const absl::Duration elapsed = absl::Now() - start;
// Allow for a slight early return, to account for quality of implementation
// issues on various platforms.
- const absl::Duration slop = absl::Milliseconds(1);
+ absl::Duration slop = absl::Milliseconds(1);
+#ifdef _MSC_VER
+ // Use higher slop on MSVC due to flaky test failures.
+ slop = absl::Milliseconds(4);
+#endif
EXPECT_LE(delay - slop, elapsed)
<< "Wait returned " << delay - elapsed
<< " early (with " << slop << " slop), start time was " << start;