Skip to content

test: update test-child-process-spawn-loop for Python 3

Rodrigo Muino Tomonari requested to merge github/fork/richardlau/py3 into master

Fixes SyntaxError: Missing parentheses in call to 'print'. error when python resolves to Python 3.

Refs: https://github.com/nodejs/node/pull/29298

-bash-4.2$ python --version
Python 3.6.3
-bash-4.2$ ./node test/pummel/test-child-process-spawn-loop.js
stderr:   File "<string>", line 1
    print 1024000 * "C"
                ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(1024000 * "C")?

assert.js:103
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

0 !== 1024001

    at ChildProcess.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/pummel/test-child-process-spawn-loop.js:47:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Socket.<anonymous> (internal/child_process.js:442:11)
    at Socket.emit (events.js:314:20)
    at Pipe.<anonymous> (net.js:656:12) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 0,
  expected: 1024001,
  operator: 'strictEqual'
}
-bash-4.2$

This test is in pummel so doesn't get run as part of the regular CI or default suite of tests (which is probably why this hasn't been spotted before). It is run as part of the daily/nightly builds but those seem to be broken due to test-crypto-timing-safe-equal-benchmarks failures (https://github.com/nodejs/node/issues/34073, cc @trott).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading