diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-19 06:11:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-19 06:11:19 +0800 |
commit | 81b64549ce1933974c904077eb3272ee0d4f4cf3 (patch) | |
tree | 7b35da2f84913c471808667ca67176ce042d5715 /test/travis-ufuzz.js | |
parent | 082e004b872ecb158e5a28702898688742b5da86 (diff) | |
download | tracifyjs-81b64549ce1933974c904077eb3272ee0d4f4cf3.tar.gz tracifyjs-81b64549ce1933974c904077eb3272ee0d4f4cf3.zip |
fix time-out for respawned `test/ufuzz.js` (#2814)
Diffstat (limited to 'test/travis-ufuzz.js')
-rw-r--r-- | test/travis-ufuzz.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/travis-ufuzz.js b/test/travis-ufuzz.js index f84ed684..36d1fc18 100644 --- a/test/travis-ufuzz.js +++ b/test/travis-ufuzz.js @@ -8,7 +8,8 @@ var period = 45 * 60 * 1000; var wait = 2 * 60 * 1000; var ping = 5 * 60 * 1000; if (process.argv[2] == "run") { - for (var i = 0; i < 2; i++) spawn(); + var endTime = Date.now() + period; + for (var i = 0; i < 2; i++) spawn(endTime); } else if (process.argv.length > 2) { var token = process.argv[2]; var branch = process.argv[3] || "v" + require("../package.json").version; @@ -47,7 +48,7 @@ if (process.argv[2] == "run") { console.log("Usage: test/travis-ufuzz.js <token> [branch] [repository] [concurrency]"); } -function spawn() { +function spawn(endTime) { var child = child_process.spawn("node", [ "--max-old-space-size=2048", "test/ufuzz" @@ -70,12 +71,12 @@ function spawn() { clearInterval(keepAlive); child.removeListener("exit", respawn); child.kill(); - }, period); + }, endTime - Date.now()); function respawn() { console.log(line); clearInterval(keepAlive); clearTimeout(timer); - spawn(); + spawn(endTime); } } |