p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Test failing in current build

Open dhowe opened this issue 3 years ago • 5 comments

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

  1. 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: grunt npm 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)

image

dhowe avatar Sep 07 '22 05:09 dhowe

@dhowe Can you share your node.js and npm versions as well? Does it always fail on the same test case?

limzykenneth avatar Sep 07 '22 20:09 limzykenneth

Not sure if there was an update, but I no longer see this problem

dhowe avatar Sep 08 '22 08:09 dhowe

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.

limzykenneth avatar Sep 08 '22 11:09 limzykenneth

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

  1. 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.

dhowe avatar Sep 09 '22 17:09 dhowe

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:

limzykenneth avatar Sep 09 '22 17:09 limzykenneth

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.1 and node 19.7.0 (latest versions as of this comment)
  • npm 9.6.1 and node 16.19.1
  • npm 9.5.0 and node 18.15.0
  • npm 8.19.3 and node 18.15.0
  • npm 8.19.3 and node 18.13.0

hadenlee avatar Mar 11 '23 05:03 hadenlee

@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 avatar Mar 11 '23 12:03 limzykenneth

@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 test still 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.

hadenlee avatar Mar 11 '23 16:03 hadenlee

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?

limzykenneth avatar Mar 11 '23 20:03 limzykenneth

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.

hadenlee avatar Mar 11 '23 20:03 hadenlee