Relax the thread count assertion, that is modify EXPECT_EQ -> EXPECT_GE (#79806)

Summary:
D36484910 added logarithm integration which ended up starting a new thread with the following stacktrace and causing the [caffe2/caffe2:caffe2_test_cpu_asan_no_sig tests](https://fburl.com/test/jk58c0el) to fail:

    SIGINT(2), PID: 1229124, Thread 1229126:
     # 0  c10::get_backtrace[abi:cxx11](unsigned long, unsigned long, bool)
    # 1  c10::FatalSignalHandler::stacktraceSignalHandler(bool)
    # 2  c10::FatalSignalHandler::stacktraceSignalHandler(int, siginfo_t*, void*)
    # 3  c10::FatalSignalHandler::stacktraceSignalHandlerStatic(int, siginfo_t*, void*)
    # 4  0x0000000000000000
    # 5  __GI___futex_abstimed_wait_cancelable64
    # 6  __GI___pthread_cond_wait
    # 7  std::condition_variable::wait(std::unique_lock<std::mutex>&)
    # 8  folly::AsyncLogWriter::ioThread()
    # 9  folly::AsyncLogWriter::restartThread()::$_4::operator()() const
    # 10 void std::__invoke_impl<void, folly::AsyncLogWriter::restartThread()::$_4>(std::__invoke_other, folly::AsyncLogWriter::restartThread()::$_4&&)
    # 11 std::__invoke_result<folly::AsyncLogWriter::restartThread()::$_4>::type std::__invoke<folly::AsyncLogWriter::restartThread()::$_4>(folly::AsyncLogWriter::restartThread()::$_4&&)
    # 12 void std::thread::_Invoker<std::tuple<folly::AsyncLogWriter::restartThread()::$_4> >::_M_invoke<0ul>(std::_Index_tuple<0ul>)
    # 13 std::thread::_Invoker<std::tuple<folly::AsyncLogWriter::restartThread()::$_4> >::operator()()
    # 14 std::thread::_State_impl<std::thread::_Invoker<std::tuple<folly::AsyncLogWriter::restartThread()::$_4> > >::_M_run()
    # 15 execute_native_thread_routine
    # 16 start_thread
    # 17 __GI___clone

Reviewed By: dustinh1999

Differential Revision: D37251436

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79806
Approved by: https://github.com/voznesenskym
This commit is contained in:
John Shahid
2022-06-21 00:05:47 +00:00
committed by PyTorch MergeBot
parent 71c24a6a2e
commit de9fd07093

View File

@@ -108,7 +108,7 @@ bool forkAndPipe(
keyPhraseCount += 1; \
loc += 1; \
} \
EXPECT_EQ(keyPhraseCount, expected); \
EXPECT_GE(keyPhraseCount, expected); \
} while (0)
#define TEST_FATAL_SIGNAL(signum, name, threadCount) \