| 1 |
Description: address intermittent test failures |
| 2 |
Update "outofdate" test case to ensure that the simulated build artifacts |
| 3 |
(outofdate/gen/*) have dates strictly later than the source files. |
| 4 |
. |
| 5 |
It appears that the tests were failure due to a race where "file.done" |
| 6 |
was considered out of date and thus appeared in the source set, despite |
| 7 |
being configured as up to date in the test case. |
| 8 |
. |
| 9 |
That said, it's not clear to me how it ever worked in the first place |
| 10 |
given the logic in OutOfData.outOfDate(): |
| 11 |
. |
| 12 |
if ((!ret) && (sourceFile != null)) { |
| 13 |
ret = sourceFile.lastModified() > targetFile.lastModified(); |
| 14 |
} |
| 15 |
. |
| 16 |
My assumption is that the test was previously broken/flaky, but that time |
| 17 |
was chunkier (larger quanta) until recently and so the source files had |
| 18 |
the same timestamp and so weren't strictly newer. |
| 19 |
. |
| 20 |
This patch also adds the fork=true attribute to the junit task, which |
| 21 |
resolves spurious test failures observed after the OutOfDate test was |
| 22 |
patched. |
| 23 |
Author: tony mancill <[email protected]> |
| 24 |
Origin: vendor |
| 25 |
Bug-Debian: https://bugs.debian.org/907763 |
| 26 |
Forwarded: no |
| 27 |
Last-Update: 2018-09-03 |
| 28 |
|
| 29 |
--- a/test/resources/logic/outofdate.xml |
| 30 |
+++ b/test/resources/logic/outofdate.xml |
| 31 |
@@ -92,14 +92,6 @@ |
| 32 |
</target> |
| 33 |
|
| 34 |
<target name="outofdate.init"> |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
<!-- sources --> |
| 44 |
<mkdir dir="outofdate/source/1/2/3"/> |
| 45 |
<touch file="outofdate/source/newer.text"/> |
| 46 |
@@ -108,6 +100,16 @@ |
| 47 |
<touch file="outofdate/source/1/done.y"/> |
| 48 |
<touch file="outofdate/source/1/partial.y"/> |
| 49 |
|
| 50 |
+ <!-- guarantee that some time has elapsed --> |
| 51 |
+ <sleep milliseconds="1"/> |
| 52 |
+ |
| 53 |
+ <!-- generated --> |
| 54 |
+ <mkdir dir="outofdate/gen/1/2/3"/> |
| 55 |
+ <touch file="outofdate/gen/index.done"/> |
| 56 |
+ <touch file="outofdate/gen/1/2/file.done"/> |
| 57 |
+ <touch file="outofdate/gen/1/done.c"/> |
| 58 |
+ <touch file="outofdate/gen/1/done.h"/> |
| 59 |
+ <touch file="outofdate/gen/1/partial.c"/> |
| 60 |
</target> |
| 61 |
|
| 62 |
<target name="outofdate.test" depends="outofdate.init"> |
| 63 |
--- a/build.xml |
| 64 |
+++ b/build.xml |
| 65 |
@@ -279,7 +279,7 @@ |
| 66 |
<path refid="test.classpath" /> |
| 67 |
</pathconvert> |
| 68 |
|
| 69 |
|
| 70 |
+ <junit fork="true" haltonfailure="false" haltonerror="false" |
| 71 |
errorproperty="junit.error" failureproperty="junit.failure"> |
| 72 |
<formatter type="brief" usefile="false"/> |
| 73 |
<batchtest> |