Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test: test-assert #122

Closed
targos opened this issue Dec 4, 2019 · 9 comments
Closed

Failing test: test-assert #122

targos opened this issue Dec 4, 2019 · 9 comments

Comments

@targos
Copy link
Member

targos commented Dec 4, 2019

=== release test-assert ===
Path: parallel/test-assert
/home/mzasso/git/nodejs/canary/test/common/index.js:621
        throw new assert.AssertionError({
        ^

AssertionError [ERR_ASSERTION]: Expected "actual" to be reference-equal to "expected":
+ actual - expected

  Comparison {
    code: 'ERR_ASSERTION',
+   message: 'false == true',
-   message: 'The expression evaluated to a falsy value:\n\n  assert(1 === 2)\n',
    type: [Function: AssertionError]
  }
    at new AssertionError (internal/assert/assertion_error.js:424:11)
    at Object.innerFn (/home/mzasso/git/nodejs/canary/test/common/index.js:621:15)
    at expectedException (assert.js:650:26)
    at expectsError (assert.js:775:3)
    at Function.throws (assert.js:824:3)
    at Object.expectsError (/home/mzasso/git/nodejs/canary/test/common/index.js:633:12)
    at Object.<anonymous> (/home/mzasso/git/nodejs/canary/test/parallel/test-assert.js:913:8)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1224:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: [AssertionError],
  expected: [Object],
  operator: 'common.expectsError'
}
Command: out/Release/node --expose-internals /home/mzasso/git/nodejs/canary/test/parallel/test-assert.js
@BridgeAR
Copy link
Member

BridgeAR commented Dec 4, 2019

Just a guess: I believe the V8 team considered removing stackframe.getFunction(). That function is necessary for this test to pass.

@targos
Copy link
Member Author

targos commented Dec 4, 2019

getFunction still returns a function. The problem seems to be that it returns a reference to the assert.ok function instead of the function being tested (created with new Function())

@targos
Copy link
Member Author

targos commented Dec 4, 2019

This is where it fails:

// Works in eval.
common.expectsError(
() => new Function('assert', 'assert(1 === 2);')(assert),
{
code: 'ERR_ASSERTION',
type: assert.AssertionError,
message: 'The expression evaluated to a falsy value:\n\n assert(1 === 2)\n'
}
);

@BridgeAR
Copy link
Member

BridgeAR commented Dec 4, 2019

The problem seems to be that it returns a reference to the assert.ok function instead of the function being tested

That sounds like a breaking change? I guess it could also something that was not intentional and regressed?

@targos
Copy link
Member Author

targos commented Dec 4, 2019

/cc @nodejs/v8

@ryzokuken
Copy link

@targos I guess it makes sense to open an issue on the V8 issue tracker?

@targos
Copy link
Member Author

targos commented Dec 4, 2019

@ryzokuken sure, would you like to do it? Best would be to have a repro using d8.

@ryzokuken
Copy link

@targos on it.

@targos
Copy link
Member Author

targos commented Dec 6, 2019

Actually the solution is to revert nodejs/node@5981fb7

@targos targos closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants