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

Sporadic flowauth test fails #844

Closed
greenape opened this issue May 23, 2019 · 3 comments · Fixed by #845
Closed

Sporadic flowauth test fails #844

greenape opened this issue May 23, 2019 · 3 comments · Fixed by #845
Labels
bug Something isn't working FlowAuth Issues related to FlowAuth tests Issues relating to tests

Comments

@greenape
Copy link
Member

FlowAuth tests are periodically failing on the first test, e.g. https://circleci.com/gh/Flowminder/FlowKit/59539 or see https://dashboard.cypress.io/#/projects/67obxt/runs/2933/failures/9f4670b4-f665-4edb-afa0-5f4410600139

This seems to be because cypress is sometimes not sending the cookie.

@greenape greenape added bug Something isn't working FlowAuth Issues related to FlowAuth tests Issues relating to tests CI Issues related to continuous integration & circleci labels May 23, 2019
@greenape
Copy link
Member Author

Alternatively, and based on https://circleci.com/gh/Flowminder/FlowKit/59547

The reason this is sporadically failing is because there are actually multiple instances of the app being run by uwsgi, and hence the before_first_request functions can get called multiple times. This is most obviously an issue with the demo data creation, because that will drop all the existing data and recreate it.

@greenape
Copy link
Member Author

I increasingly think that this is the issue actually - I reckon what's happening is that the demo data creation doesn't happen all in one transaction - the drop is one, the create is a second, and then the data gets populated in a third. So potentially, requests can get caught 'in between' these happening because of the multiple uwsgi workers.

@greenape
Copy link
Member Author

The more I think about it, the more of a problem this is - for example, if the container is started with the RESET_FLOWAUTH_DB, you could end up unpredictably wiping the db :\

@greenape greenape removed the CI Issues related to continuous integration & circleci label May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FlowAuth Issues related to FlowAuth tests Issues relating to tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant