Skip to content

test-repl-tab-complete.js "params and { on separate line" fails silently. #21586

Closed

Description

@rubys

In test/parallel/test-repl-tab-complete.js, the following not only fails silently, it aborts the running of the remainder of the tests in this source file:

// def has the params and { on a separate line
putIn.run([
  'var top = function() {',
  'r = function test (',
  ' one, two) {',
  'var inner = {',
  ' one:1',
  '};'
]);
testMe.complete('inner.o', getNoResultsFunction());

If this test is changed to have only assertions that pass (e.g., assert.strictEqual(null, null);, then execution continues. If it has assertions that fail (e.g., assert.strictEqual(1, 2);, then the test fails silently, the remainder of the tests are aborted, and overall success is reported.

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    testIssues and PRs related to Node.js core tests and test infrastructure.
    on Jun 29, 2018
  2. devsnek commented on Jun 29, 2018

    @devsnek
    Member

    @nodejs/repl

  3. Trott commented on Sep 21, 2018

    @Trott
    Member

    There seem to be two things going on here. First, the assertion is wrong. It shouldn't be no results. It should get inner.one.

    Second, when the test fails, nothing happens. The callback is running, but even throwing in the callback doesn't result in the error failing in this test case and a few others. Not sure why it's different. Even if I comment out all other test cases, it still exhibits this behavior.

  4. Trott commented on Sep 21, 2018

    @Trott
    Member

    Maybe domains are messing with the error handling? Maybe the REPL completer is creating a nested REPL and that contributes to the problem?

  5. Trott commented on Sep 21, 2018

    @Trott
    Member

    There seem to be two things going on here. First, the assertion is wrong. It shouldn't be no results. It should get inner.one.

    In Node.js 8.x, completion returned nothing and the test was correct. In Node.js 10.x, completion returns inner.one (which is what I would expect) but now the problem with the test is exposed.

    In some situations, the error is handled by the domain of a nested REPL so we never see it...

  6. Trott commented on Sep 21, 2018

    @Trott
    Member

    Definitely looks like it's a bug in the REPL where domains cause the nested REPL to swallow errors that should be transmitted back to the parent REPL. I've got a test for this bug and I think I have a fix that I'm testing right now.

  7. Trott commented on Sep 21, 2018

    @Trott
    Member

    Proposed fix: #23004

  8. Trott commented on Oct 2, 2018

    @Trott
    Member

    Fixed in 83d0404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.testIssues and PRs related to Node.js core tests and test infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions