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

chore: attempt to fix flapping "organization not found" tests #60418

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

mildwonkey
Copy link
Contributor

@mildwonkey mildwonkey commented Dec 15, 2022

The sqlstore Reset() function is run when the backend database is initialized. One of its tasks is ensuring that a default organization and user are created. If Reset() finds any records in the user table, it exists early.

The functions that create users for tests support auto-assigning users to an existing organization. The flapping "organization not found" is from that function. My theory is that - for reasons I have yet to discover - the test database would occasionally have a user record but not the organization. Reset() finds the user and exits early; then createUser tries to create a new user and fails because the expected org wasn't created by Reset()

I could still be wrong about all of this - I haven't been able to reproduce this locally, even after hours on a loop - so I've been re-running the test suite. The tests have run 5 times without that error (so far).

@ryantxu
Copy link
Member

ryantxu commented Dec 15, 2022

ghost in the machine

@mildwonkey mildwonkey changed the title do I think this will fix flapping tests? no. do I think I am at least close? also no. chore: attempt to fix flapping "organization not found" tests Dec 16, 2022
@mildwonkey mildwonkey marked this pull request as ready for review December 16, 2022 14:18
@mildwonkey mildwonkey requested a review from a team as a code owner December 16, 2022 14:18
@mildwonkey mildwonkey requested review from zserge, yangkb09 and ying-jeanne and removed request for a team December 16, 2022 14:18
@mildwonkey mildwonkey added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Dec 16, 2022
@mildwonkey mildwonkey added this to the 9.4.0 milestone Dec 16, 2022
Copy link
Contributor

@zserge zserge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, thanks!

@mildwonkey mildwonkey merged commit e4a877b into main Dec 16, 2022
@mildwonkey mildwonkey deleted the mildwonkey/test-flap branch December 16, 2022 15:11
@dsotirakis dsotirakis modified the milestones: 9.4.0, 9.4.0-beta1 Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend enterprise-ok no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants