Skip to content

Commit 5b89681

Browse files
committed
Move NYT::Initialize to separate "weak" hook
Move BEFORE_INIT hook to the beginning commit_hash:9cbf1d95bf1cda4bcce0d3ab9207debcab65391b
1 parent 4c00d09 commit 5b89681

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
// Since we need to call NYT::Initialize immediately on starting the program, we separate it from other BEFORE_INIT hooks.
4+
// This weak function is overriden in C++ client (see yt/cpp/mapreduce/tests/yt_initialize_hook/yt_hook.cpp).
5+
__attribute__((weak)) void InitializeYt(int, char**) {
6+
}

library/cpp/testing/unittest/utmain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <library/cpp/json/writer/json_value.h>
1010
#include <library/cpp/testing/common/env.h>
1111
#include <library/cpp/testing/hook/hook.h>
12+
#include <library/cpp/testing/hook/yt_initialize_hook.h>
1213

1314
#include <util/datetime/base.h>
1415

@@ -709,6 +710,8 @@ int NUnitTest::RunMain(int argc, char** argv) {
709710
Y_ABORT_UNLESS(!sigaction(SIGUSR2, &sa, nullptr));
710711
}
711712
#endif
713+
InitializeYt(argc, argv);
714+
712715
NTesting::THook::CallBeforeInit();
713716
InitNetworkSubSystem();
714717
Singleton<::NPrivate::TTestEnv>();

0 commit comments

Comments
 (0)