MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/util/tracing_test.cc:40–47  ·  view source on GitHub ↗

This test is a regression for ARROW-15604. OT has some static state that can be initialized after the CPU and I/O thread pools. We need to make sure OT's state persists for the lifetime of any threads in those thread pools. This test checks this by spawning a thread task that will outlive the unit test's lifetime and so teardown of static state should begin before this thread finishes.

Source from the content-addressed store, hash-verified

38// test's lifetime and so teardown of static state should begin before this
39// thread finishes.
40TEST(Tracing, OtLifetime) {
41 ASSERT_OK(::arrow::internal::GetCpuThreadPool()->Spawn([] {
42 // This thread will outlive the main test thread.
43 Span span;
44 START_SPAN(span, "Test");
45 SleepFor(0.1);
46 }));
47}
48
49// This test checks that the Span valid invariant is maintained:
50// 1. Span is invalid before START_SPAN

Callers

nothing calls this directly

Calls 4

GetCpuThreadPoolFunction · 0.85
SleepForFunction · 0.85
validMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected