[libc-commits] [libc] [libc][NFC] Attempt to deflake gettimeofday_test. (PR #69719)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Fri Oct 20 06:06:07 PDT 2023


================
@@ -15,24 +15,31 @@
 
 namespace cpp = LIBC_NAMESPACE::cpp;
 
+using LIBC_NAMESPACE::testing::tlog;
+
 TEST(LlvmLibcGettimeofday, SmokeTest) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
   void *tz = nullptr;
-  timeval tv;
 
   suseconds_t sleep_times[2] = {200, 1000};
----------------
kaladron wrote:

Since these are magic values anyway, I don't think it makes sense to double them further down.  Perhaps we should just pick 1000, 2000 here and comment above that sub-second clocks seem to get confused.

I remember awhile ago there were some motherboards whose TSCs would run backwards for some strange reason.  I haven't been able to find any indication that this is still a problem, which makes me wonder if there's a different bug here as well.  I don't know enough about system clocks, though.



https://github.com/llvm/llvm-project/pull/69719


More information about the libc-commits mailing list