From 53e6dae02bf0d9a5a1d304a3d637c083376b86a1 Mon Sep 17 00:00:00 2001 From: Evan Brown Date: Wed, 6 Mar 2024 13:40:51 -0800 Subject: Fix flaky MSVC test failures by using longer slop time. PiperOrigin-RevId: 613326708 Change-Id: I6e5ca195f208b8da0d21d70b5a035bfdc64f866d --- absl/synchronization/internal/per_thread_sem_test.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'absl/synchronization') 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; -- cgit v1.2.3