mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Fix broken caffe2 test: PlanExecutorTest.BlockingErrorPlan (#64401)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/64401 PlanExecutorTest.BlockingErrorPlan uses `ASSERT_DEATH` which internally performs a `fork()`. This can cause problems under certain configurations that use threads. This change updates this test to use the "threadsafe" style for GTest death tests in order to improve its quality in multithreaded environments. Test Plan: I confirmed that this change fixes the issue on my devvm with the following command: ``` buck test mode/dev //caffe2/caffe2:caffe2_test_cpu -- PlanExecutorTest.BlockingErrorPlan ``` Reviewed By: praihan Differential Revision: D30709447 fbshipit-source-id: 12ffd9ad0371e2e5b43a9873c80568e5ab02d246
This commit is contained in:
parent
b737629ff0
commit
f04e6594ed
1 changed files with 2 additions and 0 deletions
|
|
@ -290,6 +290,8 @@ TEST(PlanExecutorTest, BlockingErrorPlan) {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
testing::GTEST_FLAG(death_test_style) = "threadsafe";
|
||||
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-goto,hicpp-avoid-goto)
|
||||
ASSERT_DEATH(
|
||||
[] {
|
||||
|
|
|
|||
Loading…
Reference in a new issue