[all-commits] [llvm/llvm-project] 4f4ce1: [libcxx testing] Make three locking tests more rel...

David Zarzycki via All-commits all-commits at lists.llvm.org
Sat May 9 08:12:07 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f4ce13944b88bcd678e615d340c21ea1cf5d3ec
      https://github.com/llvm/llvm-project/commit/4f4ce13944b88bcd678e615d340c21ea1cf5d3ec
  Author: David Zarzycki <dave at znu.io>
  Date:   2020-05-09 (Sat, 09 May 2020)

  Changed paths:
    M libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
    M libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
    M libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp

  Log Message:
  -----------
  [libcxx testing] Make three locking tests more reliable

The challenge with measuring time in tests is that slow and/or busy
machines can cause tests to fail in unexpected ways. After this change,
three tests should be much more robust. The only remaining and tiny race
that I can think of is preemption after `--countDown`. That being said,
the race isn't fixable because the standard library doesn't provide a
way to count threads that are waiting to acquire a lock.

Reviewers: ldionne, EricWF, howard.hinnant, mclow.lists, #libc

Reviewed By: ldionne, #libc

Subscribers: dexonsmith, jfb, broadwaylamb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D79406




More information about the All-commits mailing list