[all-commits] [llvm/llvm-project] aee005: [libcxx] [test] Fix windows errors in fs.op.rename

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri Mar 19 07:13:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aee005f9128adeda48c5f16d2cd04cde49b79105
      https://github.com/llvm/llvm-project/commit/aee005f9128adeda48c5f16d2cd04cde49b79105
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp

  Log Message:
  -----------
  [libcxx] [test] Fix windows errors in fs.op.rename

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


  Commit: b982c6f5fa1bd8762554dbc79bf16b9449ca095a
      https://github.com/llvm/llvm-project/commit/b982c6f5fa1bd8762554dbc79bf16b9449ca095a
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M libcxx/test/support/filesystem_test_helper.h

  Log Message:
  -----------
  [libcxx] [test] Avoid race conditions between tests regarding temp directories

Prior to e0d01294bc124211a8ffb55e69162eb34a242680, all tests used a
random directory name, but now it is deterministic, based on the
test name. This change was done under the assumption that the filename
portion of the cwd is unique across tests that use the filesystem
test temporary directories.

When running tests locally, the cwd of the test is something like
"<build-dir>/test/<test path>/Output/copy_assign.pass.cpp.dir",
and the filename portion, "copy_assign.pass.cpp.dir", is used as
base for the temp directory names.

The change noted that there's a risk for race conditions if multiple
threads within one test try to create temp directories in parallel, but
that doesn't really happen in practice.

However, if running tests with a large number of parallel workers,
multiple tests with the same filename portion, e.g. "copy_assign.pass.cpp.dir",
can run in parallel, leading to race conditions across processes.

Therefore, add a hash of the full cwd to distinguish such cases
from each other.

Secondly, don't use two separate levels of temporary directories
(<base>/static_env.0). When cleaning up, only the individual
directory is removed, leaving the empty intermediate directory
behind littering the temp directory.

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


  Commit: 2ec9239a7b1faf880a130d6e5146883b48c85681
      https://github.com/llvm/llvm-project/commit/2ec9239a7b1faf880a130d6e5146883b48c85681
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp

  Log Message:
  -----------
  [libcxx] [test] Fix weakly_canonical for windows

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


Compare: https://github.com/llvm/llvm-project/compare/a9fc44c55732...2ec9239a7b1f


More information about the All-commits mailing list