Skip to content

Test failures with TERM=dumb #28064

@richardlau

Description

@richardlau
  • Version: master
  • Platform: Linux/AIX
  • Subsystem: test

Some tests, e.g. parallel/test-console-clear, fail when the TERM environment variable is dumb, e.g. on Linux:

-bash-4.2$ echo $TERM
xterm-256color
-bash-4.2$ ./node test/parallel/test-console-clear.js
-bash-4.2$ TERM=dumb ./node test/parallel/test-console-clear.js
assert.js:89
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ ''
- '\u001b[1;1H\u001b[0J'
    at doTest (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-console-clear.js:17:10)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-console-clear.js:21:1)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '',
  expected: '\u001b[1;1H\u001b[0J',
  operator: 'strictEqual'
}
-bash-4.2$

Noticed on our CI, where tests are failing on one of the AIX executors, test-osuosl-aix61-ppc64_be-2, which has TERM set to dumb according to Jenkins, e.g. https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix61-ppc64/23627/. (The other two AIX executors have TERM set to xterm and screen-256color and the tests pass on them.)

I guess there are two issues here:

  1. the tests should be tolerant of TERM=dumb (either they should pass or at least skip)
  2. test-osuosl-aix61-ppc64_be-2 should probably have a different TERM setting (cc @nodejs/build-infra @nodejs/platform-aix)
The twelve failing tests
-bash-4.2$ echo $TERM
xterm-256color
-bash-4.2$ ./tools/test.py -J parallel
[00:21|% 100|+ 2236|-   0]: Done
-bash-4.2$ TERM=dumb ./tools/test.py -J parallel
=== release test-console-clear ===
Path: parallel/test-console-clear
assert.js:89
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ ''
- '\u001b[1;1H\u001b[0J'
    at doTest (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-console-clear.js:17:10)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-console-clear.js:21:1)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '',
  expected: '\u001b[1;1H\u001b[0J',
  operator: 'strictEqual'
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-console-clear.js
=== release test-readline-position ===
Path: parallel/test-readline-position
assert.js:89
  throw new AssertionError(obj);
  ^

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

3 !== 2

    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline-position.js:40:12)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 3,
  expected: 2,
  operator: 'strictEqual'
}
Command: out/Release/node --expose-internals /home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline-position.js
=== release test-repl-editor ===
Path: parallel/test-repl-editor
assert.js:89
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ '> .editor\n// Entering editor mode (^D to finish, ^C to cancel)\n\n(To exit, press ^C again or ^D or type .exit)\n> '
- '\u001b[1G\u001b[0J> \u001b[3G.editor\n// Entering editor mode (^D to finish, ^C to cancel)\n\n(To exit, press ^C again or ^D or type .exit)\n\u001b[1G\u001b[0J> \u001b[3G'
    at run (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-editor.js:42:10)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-editor.js:74:7)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '> .editor\n// Entering editor mode (^D to finish, ^C to ' +
    'cancel)\n\n(To exit, press ^C again or ^D or type .exit)\n> ',
  expected: '\u001b[1G\u001b[0J> \u001b[3G.editor\n// Entering editor mode (^D to finish, ^C to ' +
    'cancel)\n\n(To exit, press ^C again or ^D or type .exit)\n\u001b[1G\u001b[0J> ' +
    '\u001b[3G',
  operator: 'strictEqual'
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-editor.js
=== release test-readline ===
Path: parallel/test-readline
assert.js:89
  throw new AssertionError(obj);
  ^

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

6 !== 0

    at /home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline.js:78:12
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline.js:76:47)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 6,
  expected: 0,
  operator: 'strictEqual'
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline.js
=== release test-readline-interface ===
Path: parallel/test-readline-interface
readline.js:1158
            throw err;
            ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ '\tfo\to\t'
- 'foo'
    at Interface.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline-interface.js:345:14)
    at Interface.emit (events.js:200:13)
    at Interface._onLine (readline.js:314:10)
    at Interface._line (readline.js:691:8)
    at Interface._ttyWriteDumb (readline.js:835:14)
    at FakeInput.onkeypress (readline.js:189:10)
    at FakeInput.emit (events.js:200:13)
    at emitKeys (internal/readline.js:424:14)
    at emitKeys.next (<anonymous>)
    at FakeInput.onData (readline.js:1145:36) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '\tfo\to\t',
  expected: 'foo',
  operator: 'strictEqual'
}
Command: out/Release/node --expose_internals /home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline-interface.js
=== release test-readline-undefined-columns ===
Path: parallel/test-readline-undefined-columns
assert.js:362
    throw err;
    ^

AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert(/process\.std\b/.test(output))

    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline-undefined-columns.js:38:1)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-readline-undefined-columns.js
=== release test-repl-history-navigation ===
Path: parallel/test-repl-history-navigation
Mismatched runTest function calls. Expected exactly 2, actual 0.
    at Object.mustCall (/home/users/riclau/sandbox/github/nodejs/test/common/index.js:340:10)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-history-navigation.js:76:28)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11
Command: out/Release/node --expose-internals /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-history-navigation.js
=== release test-repl-eval-scope ===
Path: parallel/test-repl-eval-scope
Mismatched <anonymous> function calls. Expected exactly 1, actual 0.
    at Object.mustCall (/home/users/riclau/sandbox/github/nodejs/test/common/index.js:340:10)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-eval-scope.js:10:18)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-eval-scope.js
=== release test-repl-load-multiline ===
Path: parallel/test-repl-load-multiline
assert.js:89
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ '.load /home/users/riclau/sandbox/github/nodejs/test/fixtures/repl-load-multiline.js\n'
- ".load /home/users/riclau/sandbox/github/nodejs/test/fixtures/repl-load-multiline.js\nconst getLunch = () =>\n  placeOrder('tacos')\n    .then(eat);\nconst placeOrder = (order) => Promise.resolve(order);\nconst eat = (food) => '<nom nom nom>';\n\nundefined\n"
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-load-multiline.js:38:8)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '.load ' +
    '/home/users/riclau/sandbox/github/nodejs/test/fixtures/repl-load-multiline.js\n',
  expected: '.load ' +
    '/home/users/riclau/sandbox/github/nodejs/test/fixtures/repl-load-multiline.js\n' +
    "const getLunch = () =>\n  placeOrder('tacos')\n    .then(eat);\n" +
    'const placeOrder = (order) => Promise.resolve(order);\nconst eat ' +
    "= (food) => '<nom nom nom>';\n\nundefined\n",
  operator: 'strictEqual'
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-load-multiline.js
=== release test-repl-persistent-history ===
Path: parallel/test-repl-persistent-history
Mismatched runTest function calls. Expected exactly 10, actual 0.
    at Object.mustCall (/home/users/riclau/sandbox/github/nodejs/test/common/index.js:340:10)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-persistent-history.js:166:28)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11
Command: out/Release/node --expose-internals /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-persistent-history.js
=== release test-repl-programmatic-history ===
Path: parallel/test-repl-programmatic-history
Mismatched runTest function calls. Expected exactly 10, actual 0.
    at Object.mustCall (/home/users/riclau/sandbox/github/nodejs/test/common/index.js:340:10)
    at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-programmatic-history.js:164:28)
    at Module._compile (internal/modules/cjs/loader.js:781:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:792:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:844:10)
    at internal/main/run_main_module.js:17:11
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-programmatic-history.js
=== release test-repl-end-emits-exit ===
Path: parallel/test-repl-end-emits-exit
assert.js:89
  throw new AssertionError(obj);
  ^

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

0 !== 1

    at process.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-end-emits-exit.js:70:10)
    at process.emit (events.js:205:15)
    at process.EventEmitter.emit (domain.js:471:20)
    at process.topLevelDomainCallback (domain.js:126:23) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 0,
  expected: 1,
  operator: 'strictEqual'
}
Command: out/Release/node /home/users/riclau/sandbox/github/nodejs/test/parallel/test-repl-end-emits-exit.js
[00:21|% 100|+ 2224|-  12]: Done
-bash-4.2$

Metadata

Metadata

Assignees

No one assigned

    Labels

    testIssues and PRs related to the tests.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions