p5.js
p5.js copied to clipboard
Test failing in current build
Most appropriate sub-area of p5.js?
- [ ] Accessibility
- [ ] Color
- [ ] Core/Environment/Rendering
- [ ] Data
- [ ] DOM
- [ ] Events
- [ ] Image
- [ ] IO
- [ ] Math
- [ ] Typography
- [ ] Utilities
- [ ] WebGL
- [x] Build Process
- [ ] Unit Testing
- [ ] Internalization
- [ ] Friendly Errors
- [ ] Other (specify if possible)
p5.js version
1.4.2
Web browser and version
NA
Operating System
OS X 11.6.2
Steps to reproduce this
Follow the instructions here: https://p5js.org/contributor-docs/#/?id=development-process and note failing tests in console and browser:
867 passing (60s) 1 failing
- src/io/files.js loadJSON documentation example #1 works: Error: Timeout of 4000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Warning: [object Object] Use --force to continue.
Aborted due to warnings. npm ERR! code ELIFECYCLE npm ERR! errno 3 npm ERR! [email protected] grunt:
gruntnpm ERR! Exit status 3 npm ERR! npm ERR! Failed at the [email protected] grunt script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
AND (in the browser)
@dhowe Can you share your node.js and npm versions as well? Does it always fail on the same test case?
Not sure if there was an update, but I no longer see this problem
Don't think there's an update recently. I'm working on the build and release process at the moment and I'll see how much I can optimize and streamline things. I'll close this for now but if you encounter this problem again and can isolate it, comment here and I'll reopen.
Ok, so this occurs consistently with node v 16.x at least (though it may be that we want to direct users away from this release):
$ npm -v
8.1.2
$ node -v
v16.13.1
868 passing (56s) 1 failing
- src/io/files.js loadJSON documentation example #1 works: Error: Timeout of 4000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Warning: [object Object] Use --force to continue.
Aborted due to warnings.
I think I may know what it is but I should have already fixed it...but in any case node 16 causes problems with npm install as well (or rather npm bundle with node 16 causes problems), so it just adds another problem we need to resolve for node 16 :disappointed:
FWIW, I'm facing the same issue with node 14 (p5.js 1.6.0):
$ npm -v
6.14.10
$ node -v
v14.15.4
results of npm test:
...
✅ example #1 works
p5.MonoSynth documentation
✅ example #1 works
p5.PolySynth documentation
✅ example #1 works
1 failing
872 passing (34s)
1) lib/addons/p5.sound.js
process documentation
example #1 works:
Error: Timeout of 4000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Warning: [object Object] Use --force to continue.
Aborted due to warnings.
npm ERR! Test failed. See above for more details.
Update: I've tried following combinations of npm/node versions, and the same error occurred in each case.
- npm
9.6.1and node19.7.0(latest versions as of this comment) - npm
9.6.1and node16.19.1 - npm
9.5.0and node18.15.0 - npm
8.19.3and node18.15.0 - npm
8.19.3and node18.13.0
@hadenlee node 14 and node 16 are not supported for building node.js anymore (node 14 EOL is only about a month away and default npm version bundled with many versions of node 16 have a bug that prevents install).
I can't replicate the error you are seeing so if you can provide some more information or do some extra tests (running on a different computer for example) it would help.
@limzykenneth thanks for the comment! Indeed, it worked on a different machine.
In case others find this helpful:
- So my earlier comment was on OS X 13.2.1 with M1 chip. For various npm/node versions (excluding node 14/16),
npm teststill did not work; in particular the latest versions (npm 9.5.0 and node 19.7.0) didn't work. - On a different machine (OS X 11.7, Intel) it worked with npm 9.5.0 and node 19.7.0 (latest versions). Did not try other versions.
I wonder if it's due to the chip (Intel vs. Apple M1) for some reason? I found one old issue when searching for M1 or ARM64 but that seems like installation-related, not test-related.
I'm new to node/npm/p5.js, so I don't know how easy/hard a fix will be (given that it's hard to reproduce this), but I would be happy to try any suggestions to make this work on my M1 machine.
I tried on an M1 machine with macOS 12.5.1 (can't update it to newer versions at the moment) and still cannot replicate, although I doubt the system architecture or OS would be the problem.
What are the installed Chrome and Safari versions on both machines you tested?
For M1 machine
- Chrome: Version 109.0.5414.119 (Official Build) (arm64)
- Safari: Version 16.3 (18614.4.6.1.6)
For other machine
- Chrome: Version 109.0.5414.119 (Official Build) (x86_64)
- Safari: Version 14.1.2 (16611.3.10.1.15)
On both machines, Chrome is set to be the default browser if that matters.