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 in CI: caused by Mocha's new unhandledRejection listener #526

Closed
0xSage opened this issue Nov 2, 2020 · 0 comments · Fixed by #528
Closed

Failing test in CI: caused by Mocha's new unhandledRejection listener #526

0xSage opened this issue Nov 2, 2020 · 0 comments · Fixed by #528
Assignees
Labels
api: clouderrorreporting Issues related to the googleapis/nodejs-error-reporting API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@0xSage
Copy link
Contributor

0xSage commented Nov 2, 2020

  1. error-reporting
    "before all" hook for "Should correctly publish an error that is an Error object":

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

1 !== 0

  + expected - actual

  -1
  +0
  
  at Context.<anonymous> (build/system-test/error-reporting.js:342:16)
      -> /workspace/system-test/error-reporting.ts:447:12
  at processImmediate (internal/timers.js:456:21)

Cause: Last week Mocha 15 added a default listener on the unhandledRejection event. See mochajs/mocha/issues/2640

(reason, promise) => {
      if (isMochaError(reason)) {
        debug(
          'trapped unhandled rejection coming out of Mocha; forwarding to uncaught handler:',
          reason
        );
        this.uncaught(reason);
      } else {
        debug(
          'trapped unhandled rejection from (probably) user code; re-emitting on process'
        );
        this._removeEventListener(
          process,
          'unhandledRejection',
          this.unhandled
        );
        try {
          process.emit('unhandledRejection', reason, promise);
        } finally {
          this._addEventListener(process, 'unhandledRejection', this.unhandled);
        }
      }
    }
@0xSage 0xSage added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. api: clouderrorreporting Issues related to the googleapis/nodejs-error-reporting API. labels Nov 2, 2020
@0xSage 0xSage self-assigned this Nov 2, 2020
@0xSage 0xSage changed the title Failing test in CI Failing test in CI caused by Mocha now autohandling unhandledRejection Nov 3, 2020
@0xSage 0xSage changed the title Failing test in CI caused by Mocha now autohandling unhandledRejection Failing test in CI: caused by Mocha's new unhandledRejection listener Nov 3, 2020
@bcoe bcoe closed this as completed in #528 Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: clouderrorreporting Issues related to the googleapis/nodejs-error-reporting API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant