Skip to content

Commit 11f7cd6

Browse files
authored
fix tensor_util_test
Differential Revision: D115784003 Pull Request resolved: pytorch#21792
1 parent c6213ae commit 11f7cd6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎runtime/core/exec_aten/util/test/tensor_util_test.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class TensorUtilTest : public ::testing::Test {
3131
TensorFactory<ScalarType::Double> tf_double_;
3232
TensorFactory<ScalarType::Bool> tf_bool_;
3333

34+
static void SetUpTestSuite() {
35+
// Fork-based death tests deadlock when libtorch's thread pool (~40
36+
// threads) is active; use threadsafe style.
37+
::testing::GTEST_FLAG(death_test_style) = "threadsafe";
38+
}
39+
3440
void SetUp() override {
3541
// As some of these tests cause ET_LOG to be called, the PAL must be
3642
// initialized first by calling runtime_init();

0 commit comments

Comments
 (0)