aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorazevaykin <azevaykin@ydb.tech>2023-12-07 12:51:22 +0300
committerazevaykin <azevaykin@ydb.tech>2023-12-07 13:37:05 +0300
commitb02752271b118467bfccb968d4ef887635c3d357 (patch)
treecdac9c941e8192314a86f08ee20ffb4f8c2e8afe
parent486a2e0697f435e92b4e37feca8d99765df34fa1 (diff)
downloadydb-b02752271b118467bfccb968d4ef887635c3d357.tar.gz
Remove the observer before return from function
-rw-r--r--ydb/core/tx/datashard/ut_common/datashard_ut_common.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/ydb/core/tx/datashard/ut_common/datashard_ut_common.cpp b/ydb/core/tx/datashard/ut_common/datashard_ut_common.cpp
index ab18bd8673..00e0125d9c 100644
--- a/ydb/core/tx/datashard/ut_common/datashard_ut_common.cpp
+++ b/ydb/core/tx/datashard/ut_common/datashard_ut_common.cpp
@@ -816,8 +816,10 @@ ui64 TFakeMiniKQLProxy::Plan(ui64 stepId, const TMap<ui64, TFakeProxyTx::TPtr>&
return TTestActorRuntime::EEventAction::PROCESS;
};
- if (immEvents || DelayedReadSets || DelayedData) {
- Tester.Runtime.SetObserverFunc(observer);
+ NActors::TTestActorRuntime::TEventObserver prevObserver;
+ bool catchEvents = immEvents || DelayedReadSets || DelayedData;
+ if (catchEvents) {
+ prevObserver = Tester.Runtime.SetObserverFunc(observer);
}
while (acks || plans || (results && waitForResult) || streams) {
@@ -992,6 +994,10 @@ ui64 TFakeMiniKQLProxy::Plan(ui64 stepId, const TMap<ui64, TFakeProxyTx::TPtr>&
}
}
+ if (catchEvents) {
+ Tester.Runtime.SetObserverFunc(prevObserver);
+ }
+
return stepId;
}