forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: reduce unmanaged parallelism in domain test
The original test lauches 10 child processes at once and bypass `test.py`'s process regulation. This PR reduces the unmanaged parallelism and is a temporary workaround for nodejs#9979 (not a real fix). PR-URL: nodejs#10329 Reviewed-By: Anna Henningsen <anna@addaleax.net>
- Loading branch information
1 parent
c325cff
commit e2b631f
Showing
12 changed files
with
247 additions
and
168 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
18 changes: 18 additions & 0 deletions
18
test/parallel/test-domain-no-error-handler-abort-on-uncaught-0.js
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,18 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
|
||
d.run(function() { | ||
throw new Error('boom!'); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
21 changes: 21 additions & 0 deletions
21
test/parallel/test-domain-no-error-handler-abort-on-uncaught-1.js
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,21 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
const d2 = domain.create(); | ||
|
||
d.run(function() { | ||
d2.run(function() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
20 changes: 20 additions & 0 deletions
20
test/parallel/test-domain-no-error-handler-abort-on-uncaught-2.js
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,20 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
|
||
d.run(function() { | ||
setTimeout(function() { | ||
throw new Error('boom!'); | ||
}, 1); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
20 changes: 20 additions & 0 deletions
20
test/parallel/test-domain-no-error-handler-abort-on-uncaught-3.js
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,20 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
|
||
d.run(function() { | ||
setImmediate(function() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
20 changes: 20 additions & 0 deletions
20
test/parallel/test-domain-no-error-handler-abort-on-uncaught-4.js
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,20 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
|
||
d.run(function() { | ||
process.nextTick(function() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
21 changes: 21 additions & 0 deletions
21
test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js
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,21 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
|
||
d.run(function() { | ||
var fs = require('fs'); | ||
fs.exists('/non/existing/file', function onExists() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
26 changes: 26 additions & 0 deletions
26
test/parallel/test-domain-no-error-handler-abort-on-uncaught-6.js
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,26 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
const d2 = domain.create(); | ||
|
||
d.on('error', function errorHandler() { | ||
}); | ||
|
||
d.run(function() { | ||
d2.run(function() { | ||
setTimeout(function() { | ||
throw new Error('boom!'); | ||
}, 1); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
26 changes: 26 additions & 0 deletions
26
test/parallel/test-domain-no-error-handler-abort-on-uncaught-7.js
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,26 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
const d2 = domain.create(); | ||
|
||
d.on('error', function errorHandler() { | ||
}); | ||
|
||
d.run(function() { | ||
d2.run(function() { | ||
setImmediate(function() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
26 changes: 26 additions & 0 deletions
26
test/parallel/test-domain-no-error-handler-abort-on-uncaught-8.js
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,26 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
const d2 = domain.create(); | ||
|
||
d.on('error', function errorHandler() { | ||
}); | ||
|
||
d.run(function() { | ||
d2.run(function() { | ||
process.nextTick(function() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
27 changes: 27 additions & 0 deletions
27
test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js
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 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const domain = require('domain'); | ||
|
||
function test() { | ||
const d = domain.create(); | ||
const d2 = domain.create(); | ||
|
||
d.on('error', function errorHandler() { | ||
}); | ||
|
||
d.run(function() { | ||
d2.run(function() { | ||
var fs = require('fs'); | ||
fs.exists('/non/existing/file', function onExists() { | ||
throw new Error('boom!'); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
if (process.argv[2] === 'child') { | ||
test(); | ||
} else { | ||
common.childShouldThrowAndAbort(); | ||
} |
Oops, something went wrong.