Skip to content

Commit d551911

Browse files
added functionality for the "--dont-use-log-files" flag (#7185)
1 parent dd9f3fd commit d551911

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

ydb/public/tools/lib/cmds/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ def deploy(arguments):
388388
'mon_port': node.mon_port,
389389
'command': node.command,
390390
'cwd': node.cwd,
391-
'stdin_file': node.stdin_file_name,
392391
'stderr_file': node.stderr_file_name,
393392
'stdout_file': node.stdout_file_name,
394393
'pdisks': [
@@ -471,7 +470,6 @@ def start(arguments):
471470
files = {}
472471
if node_meta['stderr_file'] is not None and os.path.exists(node_meta['stderr_file']):
473472
files = {
474-
'stdin_file': node_meta['stdin_file'],
475473
'stderr_file': node_meta['stderr_file'],
476474
'stdout_file': node_meta['stdout_file'],
477475
}

ydb/tests/library/harness/daemon.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def __init__(
5959
command,
6060
cwd,
6161
timeout,
62-
stdin_file=yatest_common.work_path('stdin'),
6362
stdout_file=yatest_common.work_path('stdout'),
6463
stderr_file=yatest_common.work_path('stderr'),
6564
stderr_on_error_lines=0,
@@ -73,21 +72,13 @@ def __init__(
7372
self.killed = False
7473
self.__core_pattern = core_pattern
7574
self.logger = logger.getChild(self.__class__.__name__)
76-
self.__stdout_file = open(stdout_file, mode='w+b')
77-
self.__stdin_file = open(stdin_file, mode='w+b')
78-
self.__stderr_file = open(stderr_file, mode='w+b')
75+
self.__stdout_file = open(stdout_file, mode='wb')
76+
self.__stderr_file = open(stderr_file, mode='wb')
7977

8078
@property
8179
def daemon(self):
8280
return self.__daemon
8381

84-
@property
85-
def stdin_file_name(self):
86-
if self.__stdin_file is not sys.stdin:
87-
return os.path.abspath(self.__stdin_file.name)
88-
else:
89-
return None
90-
9182
@property
9283
def stdout_file_name(self):
9384
if self.__stdout_file is not sys.stdout:
@@ -115,7 +106,6 @@ def start(self):
115106
self.__command,
116107
check_exit_code=False,
117108
cwd=self.__cwd,
118-
stdin=self.__stdin_file,
119109
stdout=self.__stdout_file,
120110
stderr=stderr_stream,
121111
wait=False,

ydb/tests/library/harness/kikimr_runner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ def __init__(self, node_id, config_path, port_allocator, cluster_name, configura
7777

7878
if configurator.use_log_files:
7979
self.__log_file = tempfile.NamedTemporaryFile(dir=self.cwd, prefix="logfile_", suffix=".log", delete=False)
80+
kwargs = {}
8081
else:
8182
self.__log_file = None
83+
kwargs = {
84+
"stdout_file": "/dev/stdout",
85+
"stderr_file": "/dev/stderr"
86+
}
8287

83-
daemon.Daemon.__init__(self, self.command, cwd=self.cwd, timeout=180, stderr_on_error_lines=240)
88+
daemon.Daemon.__init__(self, self.command, cwd=self.cwd, timeout=180, stderr_on_error_lines=240, **kwargs)
8489
self.__binary_path = None
8590

8691
@property

0 commit comments

Comments
 (0)