| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3dbcc3d commit b64828d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,6 @@ test-fs-watch-enoent : FAIL, PASS | |||
| 34 | 34 | # Disable so we don't get failures now that AIX has been | |
| 35 | 35 | # added to regular CI runs | |
| 36 | 36 | test-regress-GH-1899 : FAIL, PASS | |
| 37 | - test-stdio-closed : FAIL, PASS | ||
| 38 | 37 | ||
| 39 | 38 | # Flaky until https://github.com/nodejs/build/issues/415 is resolved. | |
| 40 | 39 | # On some of the buildbots, AAAA queries for localhost don't resolve | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,26 +1,36 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - var common = require('../common'); | ||
| 3 | - var assert = require('assert'); | ||
| 4 | - var spawn = require('child_process').spawn; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const spawn = require('child_process').spawn; | ||
| 5 | 5 | ||
| 6 | 6 | if (common.isWindows) { | |
| 7 | 7 | common.skip('platform not supported.'); | |
| 8 | 8 | return; | |
| 9 | 9 | } | |
| 10 | 10 | ||
| 11 | 11 | if (process.argv[2] === 'child') { | |
| 12 | - process.stdout.write('stdout', function() { | ||
| 13 | - process.stderr.write('stderr', function() { | ||
| 14 | - process.exit(42); | ||
| 12 | + try { | ||
| 13 | + process.stdout.write('stdout', function() { | ||
| 14 | + try { | ||
| 15 | + process.stderr.write('stderr', function() { | ||
| 16 | + process.exit(42); | ||
| 17 | + }); | ||
| 18 | + } catch (e) { | ||
| 19 | + process.exit(84); | ||
| 20 | + } | ||
| 15 | 21 | }); | |
| 16 | - }); | ||
| 22 | + } catch (e) { | ||
| 23 | + assert.strictEqual(e.code, 'EBADF'); | ||
| 24 | + assert.strictEqual(e.message, 'EBADF: bad file descriptor, write'); | ||
| 25 | + process.exit(126); | ||
| 26 | + } | ||
| 17 | 27 | return; | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | // Run the script in a shell but close stdout and stderr. | |
| 21 | - var cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`; | ||
| 22 | - var proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' }); | ||
| 31 | + const cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`; | ||
| 32 | + const proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' }); | ||
| 23 | 33 | ||
| 24 | 34 | proc.on('exit', common.mustCall(function(exitCode) { | |
| 25 | - assert.equal(exitCode, 42); | ||
| 35 | + assert.strictEqual(exitCode, common.isAix ? 126 : 42); | ||
| 26 | 36 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments