C2LC-305: Unhandled promise rejection in Interpreter tests.

Metadata

Source
C2LC-305
Type
Bug
Priority
N/A
Status
Done
Resolution
N/A
Assignee
N/A
Reporter
Created
2021-03-04T04:27:11.524-0500
Updated
2021-04-29T10:47:33.673-0400
Versions
N/A
Fixed Versions
  1. Coding Env 0.8
Component
  1. Coding Environment

Description

In working on C2LC-290, I noticed a warning in the test output. I was able to track it down to the Interpreter tests.

(node:56482) UnhandledPromiseRejectionWarning: Error: expect(received).toBe(expected) // Object.is equality

Expected: 1
Received: 2
(Use `node --trace-warnings ...` to show where the warning was created)
(node:56482) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
(node:56482) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
 PASS  src/Interpreter.test.js

Not sure when this was introduced, but the warning is also there in the tests from the last merge against develop-0.7.

Comments

  • Tony Atkins [RtF] commented 2021-04-21T05:47:27.712-0400

    I think this may have been fixed somehow, or at least mitigated by the changes I made in C2LC-227The most recent test run against develop-0.8 still has the problem, but the most recent test run against C2LC-227 doesn't.

  • Tony Atkins [RtF] commented 2021-04-21T09:41:25.427-0400

    We figured out the root cause, which was calling the jest done() function twice in the offending test.  That test was also doing two things in parallel rather than chaining them properly.  It's fixed in C2LC-227.