MCPcopy Create free account
hub / github.com/apache/impala / TEST_P

Function TEST_P

be/src/kudu/util/debug-util-test.cc:371–389  ·  view source on GitHub ↗

Starts a thread performing dangerous operations and then gathers its stack trace in a loop trying to trigger races.

Source from the content-addressed store, hash-verified

369// Starts a thread performing dangerous operations and then gathers
370// its stack trace in a loop trying to trigger races.
371TEST_P(RaceTest, TestStackTraceRaces) {
372 DangerousOp op = GetParam();
373 CountDownLatch l(1);
374 scoped_refptr<Thread> t;
375 ASSERT_OK(Thread::Create("test", "test thread",
376 [op, &l]() { DangerousOperationThread(op, &l); }, &t));
377 SCOPED_CLEANUP({
378 // Allow the thread to finish.
379 l.CountDown();
380 // Crash if we can't join the thread after a reasonable amount of time.
381 // That probably indicates a deadlock.
382 CHECK_OK(ThreadJoiner(t.get()).give_up_after_ms(10000).Join());
383 });
384 MonoTime end_time = MonoTime::Now() + MonoDelta::FromSeconds(1);
385 while (MonoTime::Now() < end_time) {
386 StackTrace trace;
387 GetThreadStack(t->tid(), &trace);
388 }
389}
390
391void BlockSignalsThread() {
392 sigset_t set;

Callers

nothing calls this directly

Calls 8

CreateClass · 0.85
DangerousOperationThreadFunction · 0.85
ThreadJoinerClass · 0.85
GetThreadStackFunction · 0.85
CountDownMethod · 0.80
getMethod · 0.65
JoinMethod · 0.45
tidMethod · 0.45

Tested by

no test coverage detected