Commit 70487d25 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

patch AtFork test under TSAN

Summary: TSAN detects and reports leaked threads in the child process, and exits nonzero. The parent process checks for zero exit code. Permit the TSAN exit code as well under TSAN.

Differential Revision: D34191672

fbshipit-source-id: 359fe91e617d962af2705896c392001bdd458d7b
parent ec16b8a7
......@@ -22,6 +22,7 @@
#include <glog/logging.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
TEST(ThreadLocal, AtFork) {
......@@ -93,7 +94,12 @@ TEST(ThreadLocal, AtForkOrdering) {
if (pid) {
int status;
auto pid2 = wait(&status);
EXPECT_EQ(status, 0);
EXPECT_TRUE(WIFEXITED(status));
EXPECT_THAT(
WEXITSTATUS(status),
folly::kIsSanitizeThread //
? testing::AnyOfArray({0, 66})
: testing::AnyOfArray({0}));
EXPECT_EQ(pid, pid2);
} else {
exit(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment