Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a239491

Browse files
committedDec 29, 2015
fix: bail if directory isn't writable
Since we can't exit from common.js, create an error code and exit from the test runner instead.
1 parent a686076 commit a239491

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎test/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ exports.refreshTmpDir = function() {
7070
fs.accessSync(testRoot, fs.W_OK);
7171
} catch (e) {
7272
if (e.code === 'ENOENT') {
73-
fs.mkdirSync(testRoot);
73+
process.exit(101);
7474
}
7575
}
7676

‎tools/test.py

+8
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ def RunSingle(self, parallel, thread_id):
152152
if self.shutdown_event.is_set():
153153
return
154154
self.lock.acquire()
155+
if output.ShouldExit():
156+
self.lock.release()
157+
PrintError("\nThe temporary folder you specified doesn't exist or" \
158+
" can't be written to. Take necessary actions and try again")
159+
os._exit(1)
155160
if output.UnexpectedOutput():
156161
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:
157162
self.flaky_failed.append(output)
@@ -497,6 +502,9 @@ def __init__(self, test, command, output, store_unexpected_output):
497502
self.store_unexpected_output = store_unexpected_output
498503
self.diagnostic = []
499504

505+
def ShouldExit(self):
506+
return self.output.exit_code == 101
507+
500508
def UnexpectedOutput(self):
501509
if self.HasCrashed():
502510
outcome = CRASH

0 commit comments

Comments
 (0)
Please sign in to comment.