[PATCH] D152696: Prevent deadlocks in death tests.

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 12 05:46:51 PDT 2023


hans added a comment.

I'm no expert here, but I went to check what Chromium does, and it seems to set the death_test_style to "threadsafe" for the whole test suite: https://source.chromium.org/chromium/chromium/src/+/main:base/test/test_suite.cc;l=367

> As the page linked above notes, "flags are saved before each test and restored
> afterwards", so the flag affects only the tests where it is set. This is
> important because the "threadsafe" death test style "trades increased test
> execution time (potentially dramatically so) for improved thread safety", so we
> likely don't want to set it for all tests. The tests where I've added the flag
> don't appear to suffer a significantly increated execution time.

I assume the flag only affects death tests though, and we probably do want it on all of those, so perhaps we could just set it once in third-party/unittest/UnitTestMain/TestMain.cpp ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152696/new/

https://reviews.llvm.org/D152696



More information about the cfe-commits mailing list