diff options
author | ILYA Khlopotov <iilyak@apache.org> | 2018-08-15 03:56:42 -0700 |
---|---|---|
committer | ILYA Khlopotov <iilyak@apache.org> | 2018-08-15 15:40:42 -0700 |
commit | fbe98b6defcbd004fe76831c108f9367c67b68e3 (patch) | |
tree | 276becc6ad57fd778b2d82f910c0e6c11c387bdf | |
parent | d14869e3ca7f95a3a23d5c67589c7289b85780d0 (diff) | |
download | couchdb-fbe98b6defcbd004fe76831c108f9367c67b68e3.tar.gz |
Use "/_node/<node>/_restart" from JavaScript tests
-rw-r--r-- | test/javascript/test_setup.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/javascript/test_setup.js b/test/javascript/test_setup.js index a6109b4d7..9e49cf15c 100644 --- a/test/javascript/test_setup.js +++ b/test/javascript/test_setup.js @@ -76,6 +76,14 @@ function getUptime() { return stats['uptime']; } +function restartNodeRequest(node) { + var url = "/_node/" + node +"/_restart" + var result = JSON.parse(CouchDB.request("POST", url).responseText); + if (result.ok != true) { + throw(Error('FAILED to restart: ' + node)); + } +} + function restartServer() { var olduptime = getUptime(); if (olduptime < 15) { @@ -83,7 +91,8 @@ function restartServer() { sleep(15000); olduptime = getUptime(); } - print('restart'); + + restartNodeRequest('node1@127.0.0.1'); /* Wait up to 15s for server to restart */ var start = new Date().getTime(); |