aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/lwtrace/trace_ut.cpp
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-21 12:02:10 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-21 12:02:10 +0300
commit510a24d09da65ac274206fe9d6544bc722c18a56 (patch)
treec24e5f2d237266122ac8843aaa462b2325271974 /library/cpp/lwtrace/trace_ut.cpp
parentd49283ffe563f4a1f20deef863a18f8de6a275e8 (diff)
downloadydb-510a24d09da65ac274206fe9d6544bc722c18a56.tar.gz
intermediate changes
ref:c7577ae41288ba1544a9cd1f00cdeff854fe2994
Diffstat (limited to 'library/cpp/lwtrace/trace_ut.cpp')
-rw-r--r--library/cpp/lwtrace/trace_ut.cpp58
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
}