Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: fix random data generation in TimeseriesHistogram unit test
Motivation: Occasionally encountering error like: Tests run: 23, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.204 sec - in org.dcache.tests.util.GlobTest Results : Failed tests: TimeseriesHistogramTest.updateOnTimeseriesHistogramShouldReplaceLastValue:181->assertThatUpdateReplacesLastValue:266 value was not replaced Tests run: 864, Failures: 1, Errors: 0, Skipped: 0 [INFO] dCache common ...................................... FAILURE [ 16.650 s] Modification: As the failure seems to be because the new value is the same as the old, change current method of generating a new value from old, which involves multiplication by 3 if a random value, to checking using a fixed value and adding 1 (apparently, the random number generated occasionally is 0.0, in which case multiplication by 3 does not generate a distinguishable new value). Result: All unit tests still pass. Whether this fixes the sporadic error or not remains to be seen. Change invisible to users. Target: master Request: 5.0 Request: 4.2 Request: 4.1 Request: 4.0 Request: 3.2 Requires-book: no Requires-notes: no Acked-by: Paul
- Loading branch information