MCPcopy Create free account
hub / github.com/catboost/catboost / AddEntryToCoreSearchFile

Function AddEntryToCoreSearchFile

library/cpp/testing/common/env.cpp:97–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void AddEntryToCoreSearchFile(const TString& filename, TStringBuf cmd, int pid, const TFsPath& binaryPath = TFsPath(), const TFsPath& cwd = TFsPath()) {
98 auto lock = TFileLock(filename);
99 TGuard<TFileLock> guard(lock);
100
101 TOFStream output(TFile(filename, WrOnly | ForAppend | OpenAlways));
102
103 NJson::TJsonWriter writer(&output, false);
104 writer.OpenMap();
105 writer.Write("cmd", cmd);
106 writer.Write("pid", pid);
107 if (binaryPath) {
108 writer.Write("binary_path", binaryPath);
109 }
110 if (cwd) {
111 writer.Write("cwd", cwd);
112 }
113 writer.CloseMap();
114 writer.Flush();
115
116 output.Write("\n");
117}
118
119void WatchProcessCore(int pid, const TFsPath& binaryPath, const TFsPath& cwd) {
120 auto& filename = NPrivate::GetTestEnv().CoreSearchFile;

Callers 2

WatchProcessCoreFunction · 0.85
StopProcessCoreWatchingFunction · 0.85

Calls 7

TFileLockClass · 0.85
TFsPathClass · 0.50
TFileClass · 0.50
OpenMapMethod · 0.45
WriteMethod · 0.45
CloseMapMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected