Open techcobweb opened 1 year ago
The code as-is works, though there is a theoretical timing window where it may not work, and we'd see a failure, which would be timing-dependent. On the basis that it's loads better now than it was, I think we keep this item open and move it to the backlog again for now.
Background
Run several galasa tests in separate JVMs in parallel.
One test looks at dss values and sees
So it allocates a runid of U11, and updates the dss properties so
lastused
figure to 11 so that the next test to allocate a runId doesn't clash with it's number.During the test run, several other properties get stored in the dss. eg:
in addition to the standard values:
At the end of the test run, the test attempts to revert the dss.properties to what it should be, removing all those values ralating to the run just passed.
So the entire file is over-written with
(which is obviously missing all the details about run 15)
The trouble is when there are two tests running in parallel, the other test will try to do the same. The allocation of the test runid seems to be fairly atomic, but one test tries to restore the file to what it thinks the properties should now be, and the other test is in a race condition to restore the properties file to what it thinks the contents should be.
When one test runs early, takes longer than the 2nd test, then it gets to write the file last, clobbering the values that the faster second-to-launch test takes.
Sounds like some cache of the dss.properties is being held until the end of the test and blindly written-out, rather than assuming the file has changed, reading the contents back in, modifying what needs modifying and writing it out, while locking the local file in the process.
I guess that the eclipse tests must be hitting this problem, but it's just never been noticed.
Tasks