$OpenBSD: patch-test_sequential_test-child-process-execsync_js,v 1.4 2018/02/10 14:50:35 abieber Exp $

Index: test/sequential/test-child-process-execsync.js
--- test/sequential/test-child-process-execsync.js.orig
+++ test/sequential/test-child-process-execsync.js
@@ -45,53 +45,55 @@ assert.throws(
 );
 
 let cmd, ret;
-try {
-  cmd = `"${process.execPath}" -e "setTimeout(function(){}, ${SLEEP});"`;
-  ret = execSync(cmd, { timeout: TIMER });
-} catch (e) {
-  caught = true;
-  assert.strictEqual(e.errno, 'ETIMEDOUT');
-  err = e;
-} finally {
-  assert.strictEqual(ret, undefined,
-                     `should not have a return value, received ${ret}`);
-  assert.strictEqual(caught, true, 'execSync should throw');
-  const end = Date.now() - start;
-  assert(end < SLEEP);
-  assert(err.status > 128 || err.signal);
-}
+if (!common.isOpenBSD) {
+  try {
+    cmd = `"${process.execPath}" -e "setTimeout(function(){}, ${SLEEP});"`;
+    ret = execSync(cmd, { timeout: TIMER });
+  } catch (e) {
+    caught = true;
+    assert.strictEqual(e.errno, 'ETIMEDOUT');
+    err = e;
+  } finally {
+    assert.strictEqual(ret, undefined,
+                       `should not have a return value, received ${ret}`);
+    assert.strictEqual(caught, true, 'execSync should throw');
+    const end = Date.now() - start;
+    assert(end < SLEEP);
+    assert(err.status > 128 || err.signal);
+  }
 
-assert.throws(function() {
-  execSync('iamabadcommand');
-}, /Command failed: iamabadcommand/);
+  assert.throws(function() {
+    execSync('iamabadcommand');
+  }, /Command failed: iamabadcommand/);
 
-const msg = 'foobar';
-const msgBuf = Buffer.from(`${msg}\n`);
+  const msg = 'foobar';
+  const msgBuf = Buffer.from(`${msg}\n`);
 
-// console.log ends every line with just '\n', even on Windows.
+  // console.log ends every line with just '\n', even on Windows.
 
-cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
+  cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
 
-ret = execSync(cmd);
+  ret = execSync(cmd);
 
-assert.strictEqual(ret.length, msgBuf.length);
-assert.deepStrictEqual(ret, msgBuf);
+  assert.strictEqual(ret.length, msgBuf.length);
+  assert.deepStrictEqual(ret, msgBuf);
 
-ret = execSync(cmd, { encoding: 'utf8' });
+  ret = execSync(cmd, { encoding: 'utf8' });
 
-assert.strictEqual(ret, `${msg}\n`);
+  assert.strictEqual(ret, `${msg}\n`);
 
-const args = [
-  '-e',
-  `console.log("${msg}");`
-];
-ret = execFileSync(process.execPath, args);
+  const args = [
+    '-e',
+    `console.log("${msg}");`
+  ];
+  ret = execFileSync(process.execPath, args);
 
-assert.deepStrictEqual(ret, msgBuf);
+  assert.deepStrictEqual(ret, msgBuf);
 
-ret = execFileSync(process.execPath, args, { encoding: 'utf8' });
+  ret = execFileSync(process.execPath, args, { encoding: 'utf8' });
 
-assert.strictEqual(ret, `${msg}\n`);
+  assert.strictEqual(ret, `${msg}\n`);
+}
 
 // Verify that the cwd option works - GH #7824
 {
@@ -110,17 +112,19 @@ assert.strictEqual(ret, `${msg}\n`);
 }
 
 // Verify the execFileSync() behavior when the child exits with a non-zero code.
-{
-  const args = ['-e', 'process.exit(1)'];
+if (!common.isOpenBSD) {
+  {
+    const args = ['-e', 'process.exit(1)'];
 
-  assert.throws(() => {
-    execFileSync(process.execPath, args);
-  }, (err) => {
-    const msg = `Command failed: ${process.execPath} ${args.join(' ')}`;
+    assert.throws(() => {
+      execFileSync(process.execPath, args);
+    }, (err) => {
+      const msg = `Command failed: ${process.execPath} ${args.join(' ')}`;
 
-    assert(err instanceof Error);
-    assert.strictEqual(err.message, msg);
-    assert.strictEqual(err.status, 1);
-    return true;
-  });
+      assert(err instanceof Error);
+      assert.strictEqual(err.message, msg);
+      assert.strictEqual(err.status, 1);
+      return true;
+    });
+  }
 }
