Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assume that SIGTERM = timeout, surface to user
Fixes #233, provided that we can assume that SIGTERM always indicates a timeout from the calling process.
- Loading branch information
Showing
9 changed files
with
87 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
TAP version 13 | ||
# Subtest: ___/.*/~~~pending-handles.js child | ||
ok 1 - this is ok | ||
not ok 2 - received SIGTERM with pending event queue activity | ||
not ok 2 - timeout! | ||
--- | ||
{"handles":[{"msecs":100000,"type":"Timer"}],"requests":[]} | ||
{"handles":[{"msecs":100000,"type":"Timer"}],"signal":"SIGTERM"} | ||
... | ||
Bail out! # received SIGTERM with pending event queue activity | ||
Bail out! # received SIGTERM with pending event queue activity | ||
Bail out! # timeout! | ||
Bail out! # timeout! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
TAP version 13 | ||
# Subtest: child | ||
# Subtest: child test | ||
1..2 | ||
ok 1 - this is fine | ||
not ok 2 - timeout! | ||
--- | ||
{"handles":[{"msecs":20000,"type":"Timer"}],"signal":"SIGTERM"} | ||
... | ||
Bail out! # timeout! | ||
Bail out! # timeout! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var t = require('../..') | ||
|
||
if (process.argv[2] === 'child') { | ||
t.test('child test', function (t) { | ||
t.plan(2) | ||
t.pass('this is fine') | ||
setTimeout(function (res) { | ||
t.pass('request complete') | ||
}, 20000) | ||
}) | ||
} else { | ||
t.spawn(process.execPath, [__filename, 'child'], {}, 'child', { timeout: 1000 }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
TAP version 13 | ||
# Subtest: child | ||
# Subtest: child test | ||
1..2 | ||
ok 1 - this is fine | ||
not ok 2 - timeout! | ||
--- | ||
{"handles":[{"msecs":20000,"type":"Timer"}],"signal":"SIGTERM"} | ||
... | ||
# failed 1 of 2 tests | ||
not ok 1 - child test ___/# time=[0-9.]+(ms)?/~~~ | ||
--- | ||
{"at":{"column":5,"file":"test/test/timeout-via-runner.js","line":4},"results":{"count":2,"fail":1,"ok":false,"pass":1,"plan":{"end":2,"start":1}},"source":"t.test('child test', function (t) {\n"} | ||
... | ||
|
||
1..1 | ||
# failed 1 of 1 tests | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
not ok 1 - child ___/# time=[0-9.]+(ms)?/~~~ | ||
--- | ||
{"arguments":["___/.*/~~~timeout-via-runner.js","child"],"at":{"column":5,"file":"test/test/timeout-via-runner.js","line":12},"command":"___/.*(node|iojs)(.exe)?/~~~","failure":"timeout","results":{"count":1,"fail":1,"ok":false,"pass":0,"plan":{"end":1,"start":1}},"signal":"SIGTERM","source":"t.spawn(process.execPath, [__filename, 'child'], {}, 'child', { timeout: 1000 })\n","timeout":1000} | ||
... | ||
|
||
1..1 | ||
# failed 1 of 1 tests | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters