diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-21 12:02:10 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-21 12:02:10 +0300 |
commit | 510a24d09da65ac274206fe9d6544bc722c18a56 (patch) | |
tree | c24e5f2d237266122ac8843aaa462b2325271974 /library/cpp/lwtrace/trace_ut.cpp | |
parent | d49283ffe563f4a1f20deef863a18f8de6a275e8 (diff) | |
download | ydb-510a24d09da65ac274206fe9d6544bc722c18a56.tar.gz |
intermediate changes
ref:c7577ae41288ba1544a9cd1f00cdeff854fe2994
Diffstat (limited to 'library/cpp/lwtrace/trace_ut.cpp')
-rw-r--r-- | library/cpp/lwtrace/trace_ut.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/library/cpp/lwtrace/trace_ut.cpp b/library/cpp/lwtrace/trace_ut.cpp index cb03e4fbde..afb2f4e53f 100644 --- a/library/cpp/lwtrace/trace_ut.cpp +++ b/library/cpp/lwtrace/trace_ut.cpp @@ -876,5 +876,63 @@ Y_UNIT_TEST_SUITE(LWTraceTrace) { } reader; mngr.ReadDepot("Query1", reader); } + + Y_UNIT_TEST(ShouldResetFailedForksCounterUponShuttleParking) { + TManager mngr(*Singleton<TProbeRegistry>(), true); + TQuery q; + bool parsed = NProtoBuf::TextFormat::ParseFromString(R"END( + Blocks { + ProbeDesc { + Name: "NoParam" + Provider: "LWTRACE_UT_PROVIDER" + } + Action { + RunLogShuttleAction { + MaxTrackLength: 100 + ShuttlesCount: 2 + } + } + } + )END", &q); + + UNIT_ASSERT(parsed); + mngr.New("Query1", q); + + struct { + ui32 cnt = 0; + void Push(TThread::TId, const TTrackLog&) { + ++cnt; + } + } reader; + + { + // Run shuttle ans fail fork + TOrbit initial; + TOrbit fork1; + TOrbit fork2; + + LWTRACK(NoParam, initial); + UNIT_ASSERT_VALUES_EQUAL(initial.HasShuttles(), true); + UNIT_ASSERT_VALUES_EQUAL(initial.Fork(fork1), true); + LWTRACK(IntParam, fork1, 1); + UNIT_ASSERT_VALUES_EQUAL(fork1.Fork(fork2), false); + initial.Join(fork1); + } + + mngr.ReadDepot("Query1", reader); + UNIT_ASSERT_VALUES_EQUAL(reader.cnt, 0); + + reader.cnt = 0; + + { + TOrbit initial; + + LWTRACK(NoParam, initial); + UNIT_ASSERT_VALUES_EQUAL(initial.HasShuttles(), true); + } + + mngr.ReadDepot("Query1", reader); + UNIT_ASSERT_VALUES_EQUAL(reader.cnt, 1); + } #endif // LWTRACE_DISABLE } |