Fix broken caffe2 test: PlanExecutorTest.BlockingErrorPlan (#64401)
authorSeth Elliott <sethelliott@fb.com>
Thu, 2 Sep 2021 14:48:47 +0000 (07:48 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 2 Sep 2021 15:30:29 +0000 (08:30 -0700)
commitf04e6594ed7d7657a059ef63e82e136aa2bbc0fd
tree6e29437f1f6833c92ea150df3febfbe7153f84fc
parentb737629ff0d4dd82f246b0efa6aef53f15971e78
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
caffe2/core/plan_executor_test.cc