GoogleCloudPlatform / cloud-builders-community

Community-contributed images for Google Cloud Build
https://cloud.google.com/cloud-build/
Apache License 2.0
1.26k stars 856 forks source link

yarn-puppeteer does not build due to failing tests #238

Open davidwkeith opened 5 years ago

davidwkeith commented 5 years ago

Affected builder image

gcr.io/cloud-builders-community/yarn-puppeteer

Expected Behavior

Test steps should pass in cloud build

Actual Behavior

Jest takes too long to exit and thus exits non-zero:

Already have image: gcr.io/tara-frontend/yarn-puppeteer:node-9.11.1
yarn run v1.5.1
warning ../../../package.json: No license field
$ jest --config=jest-puppeteer.js

Jest dev-server output:
warning ../../../package.json: No license field
[Jest Dev server] $ node .
[Jest Dev server] listening on port 3000.

PASS tests/index.test.js
index.js
✓ renders / (18ms)

Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.821s
Ran all test suites.
Jest did not exit one second after the test run has completed.

This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.

Steps to Reproduce the Problem

  1. cd yarn-puppeteer
  2. gcloud builds submit . --config=cloudbuild.yaml

Additional Info

Manually running the tests locally works fine, and commenting out the test steps allows a functional image to be deployed.

cesarvarela commented 5 years ago

Adding --forceExit when invoking jest might be enough.

sanastos commented 5 years ago

@cesarvarela The current yarn-puppeteer doesn't build for me, but the version in your PR does. If you want to reopen it I'll review and merge it.