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

[usage] Fix flaky test for ListWorkspacesByID #10818

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Jun 22, 2022

Description

Sometimes (~15/100 from my repeated runs), the DB cleanup hook post tests would conflict with the data creation and would cause the tests to fail due to the exact missing IDs. Generating new random IDs hasn't failed in my test runs.

How to test

Unit tests

Release Notes

NONE

Documentation

NONE

@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jun 22, 2022
@easyCZ
Copy link
Member Author

easyCZ commented Jun 22, 2022

Well, this just failed on that exact issue so this is definitely not the fix.. :P

@roboquat roboquat added size/S and removed size/XS labels Jun 22, 2022
@easyCZ
Copy link
Member Author

easyCZ commented Jun 22, 2022

/hold

@easyCZ easyCZ force-pushed the mp/usage-fix-flaky-workspace-list branch from 3e87b6c to b3a11a9 Compare June 22, 2022 11:59
@easyCZ
Copy link
Member Author

easyCZ commented Jun 22, 2022

Found the problem. We created the connection at the start of the test, but re-used it for sub-tests. This meant the hooks didn't run properly.

@easyCZ
Copy link
Member Author

easyCZ commented Jun 22, 2022

/unhold

@andrew-farries
Copy link
Contributor

What do you mean by hooks in this context?

@easyCZ
Copy link
Member Author

easyCZ commented Jun 22, 2022

What do you mean by hooks in this context?

https://github.com/gitpod-io/gitpod/blob/main/components/usage/pkg/db/conn.go#L75 - the t.Cleanup(func..) - it's a cleanup hook for the test

@roboquat roboquat merged commit af8cb45 into main Jun 22, 2022
@roboquat roboquat deleted the mp/usage-fix-flaky-workspace-list branch June 22, 2022 12:04
@easyCZ
Copy link
Member Author

easyCZ commented Jun 22, 2022

Hmm, main still fails on the 2^16 test. Trying to reproduce. https://werft.gitpod-dev.com/job/gitpod-build-main.3638

@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants