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

race condition when fetching schedule quality, just after creating an oncall-shift, leads to a "Bad" quality schedule ("Schedule is Empty") #1968

Closed
Tracked by #1692
joeyorlando opened this issue May 18, 2023 · 4 comments
Assignees
Labels
bug Something isn't working part:schedules

Comments

@joeyorlando
Copy link
Contributor

joeyorlando commented May 18, 2023

there seems to be a race condition regarding the API call we make to fetch a "Schedule Quality". Most of the time, when you create a brand new schedule and add one rotation layer, the schedule quality score will show "good" (expected). However, on rare occasions, the schedule quality score will show "bad" for the same schedule setup. It appears to be related to the response from the backend, my guess is because of some race condition in the ordering of the API calls the UI is making

@joeyorlando joeyorlando added bug Something isn't working part:schedules labels May 18, 2023
@joeyorlando joeyorlando changed the title there seems to be a race condition regarding the API call we make to fetch a "Schedule Quality". Most of the time, when you create a brand new schedule and add one rotation layer, the schedule quality score will show "good" (expected). However, on rare occasions, the schedule quality score will show "bad" for the same schedule setup. It appears to be related to the response from the backend, my guess is because of some race condition in the ordering of the API calls the UI is making race condition when fetching schedule quality, just after creating an oncall-shift, leads to a "Bad" quality schedule ("Schedule is Empty") May 18, 2023
@Matvey-Kuk
Copy link
Contributor

Can't reproduce :(

@joeyorlando
Copy link
Contributor Author

joeyorlando commented Jun 7, 2023

to reproduce:

  1. Run the project locally (ie. make init start)
  2. Follow the instructions here to setup the e2e tests locally
  3. cd grafana-plugin && yarn test:integration integration-tests/schedules/quality.test.ts --repeat-each=50

Since (I believe) it's a race condition, it's not easily reproducable via the UI. --repeat-each should reproduce it at least once. Once you're able to reproduce it, playwright will provide you with a report which has a trace/video which should be useful in debugging this.

@joeyorlando
Copy link
Contributor Author

Here are 3 playwright traces that reproduce this issue:
test-results.zip

To open these, first download the file, then:

unzip test-results.zip
npx playwright show-trace test-results/schedules-quality-check-schedule-quality-for-simple-1-user-schedule-chromium/trace.zip

@matiasb matiasb self-assigned this Jun 16, 2023
matiasb added a commit that referenced this issue Jun 20, 2023
Updating a schedule using the web UI sometimes you don't get the change
immediately available (since the ical refresh is async).
Related to #1968
@matiasb
Copy link
Contributor

matiasb commented Jun 26, 2023

I think this should have been fixed by the referenced change (reviewing last runs), please re-open if that's not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working part:schedules
Projects
None yet
Development

No branches or pull requests

3 participants