Test summary widget sometimes doesn't update when new data is available
Summary
from: !88260 (comment 966919085)
Sometimes
speculation: This sometimesreports_response
sees that report parsing has finished before compare_test_reports
has the comparison data ready. Thinking the data is ready, reports_response
passes responsibility on to compare_test_reports
, but compare_test_reports
doesn't quite have the data yet, so it thinks there is no data and returns a 204 No Content
response (with different polling and/or cache control headers?). After that, when given another opportunity to return data (such as a page refresh), compare_test_reports
does have the data after all. Both of these functions are using reactive caching.
Steps to reproduce
- create a branch that modifies test results and open a merge request for it
- run a pipeline for the base commit of the branch to generate a base test report
- run a pipeline for branch to generate a head test report
- observe the test summary merge request widget and the network panel of your browser's devtools as the head pipeline completes, some requests for
test_reports.json
should appear in the network panel as the widget polls for data:- first, there might be some
204 No Content
responses while the pipeline is running or the reports are being parsed (these are expected) - when parsing has completed, sometimes
™️ , there is another204 No Content
response that the widget reacts to by showing "Test summary failed to load results" even though new data is available, and stops polling for new data👈🏻 this is the bug🐛 - otherwise, there will be a
200 OK
response with data and the widget will update accordingly, and maybe304 Not Modified
s after that as we continue to poll in certain cases (these are both expected)
- first, there might be some
Screen_Recording_2022-06-03_at_11.08.32
headers from the 204 that triggered the error state |
headers from the 200 successful request |
---|---|
![]() |
![]() |
Example Project
What is the current bug behavior?
Sometimes, the widget shows an error state and stops polling for updated test report comparison data.
What is the expected correct behavior?
The widget should show the test report comparison results. Even if it encounters an error, we should still continue to poll for updated test report comparison data, especially if a new pipeline has been started.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)