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

Test failing since Node 18.8.0 #441

Closed
mroderick opened this issue Nov 2, 2022 · 2 comments
Closed

Test failing since Node 18.8.0 #441

mroderick opened this issue Nov 2, 2022 · 2 comments

Comments

@mroderick
Copy link
Member

While working on #439 and #440 with @hexeberlin, we discovered that one unit test is failing since Node 18.8.0

  1) FakeTimers
       stubTimers
         should replace the getEntries, getEntriesByX methods with noops that return []:
     TypeError: Cannot assign to read only property 'getEntries' of object '#<Performance>'
      at Context.<anonymous> (test/fake-timers-test.js:3884:50)
      at process.processImmediate (node:internal/timers:471:21)

How to reproduce

  1. nmv install 18.7
  2. npm run test-node
  3. Observe all tests pass
  4. nvm install 18.8
  5. npm run test-node
  6. Observe one test fails

Since this library is downloaded more ~19M times/month and Node 18 has been out for about a month and we have yet to see any error reports about failures in newer Node 18 versions, I think it's safe to say that it's only the test that is failing.

We should fix this soon, as the failing test is preventing us from merging pull requests (or alternatively, we should lock the Node 18 version to 18.7, while we fix this issue).

Plot twist: the tests pass fine in Node v19.0.0

@fatso83
Copy link
Contributor

fatso83 commented Nov 21, 2022

Looking into this. Seems to be some kind of weird runtime issue:
image

Essentially, if I configure the property descriptor in a debugger with the line from the code, it works. If it is just Node running on its own, it has no effect and fails.

Object.defineProperty(Performance.prototype, "getEntries", { writable: true })

@fatso83
Copy link
Contributor

fatso83 commented Nov 21, 2022

Ha, no, this is just about spelling! I corrected the spelling when doing this. The prop is called writable, but we have used writeable 🤣

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

2 participants