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

cloud-sql: Tests ignore unhandled promise rejections #1781

Closed
shubha-rajan opened this issue May 4, 2020 · 0 comments · Fixed by #1782
Closed

cloud-sql: Tests ignore unhandled promise rejections #1781

shubha-rajan opened this issue May 4, 2020 · 0 comments · Fixed by #1782
Assignees
Labels
api: cloudsql Issues related to the Cloud SQL for MySQL API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@shubha-rajan
Copy link
Contributor

shubha-rajan commented May 4, 2020

I found this issue when adding a new check for #1745 .
image
Unhandled rejections are also an issue with the App Engine Cloud SQL samples:
https://source.cloud.google.com/results/invocations/f8c1a2e6-2247-478f-a4e1-0200c5f0f80c/targets/cloud-devrel%2Fnodejs-docs-samples%2Fpresubmit%2Fappengine%2Fnode8%2Fcloudsql_postgresql/log

It looks like the problem is that unhandled promise rejections still return a zero exit code, which is interpreted as a build success.

@fhinkel fhinkel added api: cloudsql Issues related to the Cloud SQL for MySQL API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels May 4, 2020
@kurtisvg kurtisvg assigned shubha-rajan and unassigned kurtisvg May 4, 2020
@shubha-rajan shubha-rajan changed the title cloud-sql: Tests are passing when they shouldn't cloud-sql: Tests ignore unhandled promise rejections May 5, 2020
shubha-rajan added a commit that referenced this issue May 7, 2020
* update cloud sql postgres and mysql samples to handle rejections and exit on unhandled rejections

* handled promise rejection for pool and table creation in mysql sample

* Update server.js

* Update server.js

* refactor pool and schema setup

* Update region tag

Co-authored-by: F. Hinkelmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: cloudsql Issues related to the Cloud SQL for MySQL API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants