You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/09/13 17:38:02 UTC

[couchdb] branch master updated: Don't reset logs when JS tests restart the server

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new c622e17  Don't reset logs when JS tests restart the server
c622e17 is described below

commit c622e17ad1b5b2d8bc8c6f22ca17a7168a07dcc3
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Wed Sep 13 11:48:19 2017 -0500

    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.
---
 dev/run | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dev/run b/dev/run
index 2f25071..5693e12 100755
--- a/dev/run
+++ b/dev/run
@@ -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)

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].