diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2017-09-13 11:48:19 -0500 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2017-09-13 12:37:59 -0500 |
commit | c622e17ad1b5b2d8bc8c6f22ca17a7168a07dcc3 (patch) | |
tree | 068c4fac9df55b2f150427efb9720fcee330bbc0 /dev | |
parent | d9e2940839532a727c3e8dddf3e9f24fdd806fb1 (diff) | |
download | couchdb-c622e17ad1b5b2d8bc8c6f22ca17a7168a07dcc3.tar.gz |
Don't reset logs when JS tests restart the server
When a JS test requested a restart server we would wip the current log
file. This makes it hard to debug failing tests occasionally when they
happen just after a restart. This change prevents just opens log files
in read/write mode specifically when a test requests a server restart.
The current behavior for interactive use of `dev/run` will continue to
truncate log files on startup.
Diffstat (limited to 'dev')
-rwxr-xr-x | dev/run | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -146,6 +146,7 @@ def setup_context(opts, args): 'haproxy': opts.haproxy, 'haproxy_port': opts.haproxy_port, 'config_overrides': opts.config_overrides, + 'reset_logs': True, 'procs': []} @@ -400,8 +401,12 @@ def boot_node(ctx, node): "-pa", os.path.join(erl_libs, "*"), "-s", "boot_node" ] + if ctx['reset_logs']: + mode = "wb" + else: + mode = "r+b" logfname = os.path.join(ctx['devdir'], "logs", "%s.log" % node) - log = open(logfname, "wb") + log = open(logfname, mode) cmd = [toposixpath(x) for x in cmd] return sp.Popen(cmd, stdin=sp.PIPE, stdout=log, stderr=sp.STDOUT, env=env) @@ -545,6 +550,7 @@ def run_command(ctx, cmd): @log('Restart all nodes') def reboot_nodes(ctx): + ctx['reset_logs'] = False kill_processes(ctx) boot_nodes(ctx) ensure_all_nodes_alive(ctx) |