Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
XRAY 2021 Sprint 17
Description
Description
Multiple threads accessing the Tests Association with a Test Execution Custom Field can lead to scenarios where the Test Runs from the Test Execution are deleted.
This is a race condition where concurrent threads are mutating the same object.
One scenario where this can happen is when there are builds in CI or scripts changing the value in the Custom Field from a Test Execution, via import of results or edit issue for instance and, concurrently, there are users editing another Test Execution with more than 100 tests via Edit Issue Dialog.
Pre-conditions
- Have a Test Execution with more than 100 test runs associated (Test Exec A)
- Have one or more different Test Executions (These Test Execs will be used to simulate concurrent threads making changes on them)
How to reproduce
Via User Interface: This way is hard to reproduce but possible depending on the number of threads running at background and multithreading capability of the machine
- Edit Test Exec A opening the Edit Issue Dialog by changing the summary
- In Background there should be updates in the other Test Executions by adding or removing Tests - via scripting or builds in CI throwing requests at Jira for instance - check node JS script at updatingTestExecCF.js
Via Scripting: This is the easiest way
1) Simulate multiple Edit Issue actions via Edit Issue Dialog by throwing multiple requests to Test Exec A (you can replace the curl request below by exporting the QuickEditIssue request to curl using the Chrome dev tools):
#!/bin/bash for i in {1..500} do curl 'http://localhost:8080/secure/QuickEditIssue.jspa?issueId=656300&decorator=none' \ -H 'Connection: keep-alive' \ -H 'sec-ch-ua: "Google Chrome";v="93", " Not;A Brand";v="99", "Chromium";v="93"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36' \ -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \ -H 'Accept: */*' \ -H 'X-Requested-With: XMLHttpRequest' \ -H 'X-AUSERNAME: admin' \ -H 'sec-ch-ua-platform: "macOS"' \ -H 'Origin: http://localhost:8080' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Referer: http://localhost:8080/browse/CALC-2623' \ -H 'Accept-Language: en-GB,en;q=0.9' \ -H 'Cookie: JSESSIONID=182BECA9CB52FBDAFC07520A1EB734B3; atlassian.xsrf.token=B3XX-G5BU-ZIYD-DCBK_c84421dbfa7adf522046e9e3f56dc7eaccd91761_lin; AJS.conglomerate.cookie="|hipchat.inapp.links.first.clicked.admin=false"; jira.editor.user.mode=source' \ --data-raw 'id=656300&atl_token=B3XX-G5BU-ZIYD-DCBK_c84421dbfa7adf522046e9e3f56dc7eaccd91761_lin&formToken=84a8b68391780545cbd385f461e3f75b93fc7330&summary=sumario3&description=&reporter=admin&assignee=&priority=5&timetracking_originalestimate=&timetracking_remainingestimate=&isCreateIssue=&hasWorkStarted=&environment=&dnd-dropzone=&customfield_10117=&customfield_10118=&customfield_10119=&customfield_10115=RAVEN_IGNORE&comment=&commentLevel=' \ --compressed done
2 - In Background there should be updates in the other Test Executions by adding or removing Tests - via scripting or builds in CI throwing requests at Jira for instance - check node JS script at updatingTestExecCF.js
Actual result/Attachments
Test Runs will be deleted in Test Exec A
Expected result
Test Runs should never be deleted
Version
- 5.0.5 by the time this was reported