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

[abort-controller] unit tests are failing in Node.js v20.3.0 #4826

Closed
3 tasks done
trivikr opened this issue Jun 12, 2023 · 2 comments · Fixed by #4844
Closed
3 tasks done

[abort-controller] unit tests are failing in Node.js v20.3.0 #4826

trivikr opened this issue Jun 12, 2023 · 2 comments · Fixed by #4844
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog

Comments

@trivikr
Copy link
Member

trivikr commented Jun 12, 2023

Checkboxes for prior research

Describe the bug

The unit tests of abort-controller throw the following error in Node.js v20.3.0:

TypeError: Cannot assign to read only property 'performance' of object '[object global]'

This is likely an issue with jest, and not with the SDK. The tests need to be fixed though.

SDK version number

main

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.3.0

Reproduction Steps

Run unit tests in abort-controller

Observed Behavior

$ abort-controller> yarn test
yarn run v1.22.17
$ jest
 FAIL  src/AbortController.spec.ts
  ● Test suite failed to run

    TypeError: Cannot assign to read only property 'performance' of object '[object global]'

      2 | import { AbortSignal } from "./AbortSignal";
      3 |
    > 4 | jest.useFakeTimers();
        |      ^
      5 |
      6 | describe("AbortController", () => {
      7 |   it("should communicate cancellation via its signal", () => {

      at hijackMethod (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:946:32)
      at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1733:17)
      at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36)
      at Object.<anonymous> (src/AbortController.spec.ts:4:6)

 PASS  src/AbortSignal.spec.ts

Test Suites: 1 failed, 1 passed, 2 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        1.574 s, estimated 2 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected Behavior

$ abort-controller> yarn test
...
Test Suites: 2 passed, 2 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.856 s
Ran all test suites.
✨  Done in 2.64s.

Possible Solution

No response

Additional Information/Context

Probably related #4824

@trivikr trivikr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. p2 This is a standard priority issue queued This issues is on the AWS team's backlog and removed needs-triage This issue or PR still needs to be triaged. labels Jun 12, 2023
@trivikr
Copy link
Member Author

trivikr commented Jun 14, 2023

This was fixed in Jest 29.x as per jestjs/jest#13603 (comment)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant