Intermittent off-by-one-second failure in TimeKvpParserTest.testContinuousRelativeInterval

Description

gs-ows TimeKvpParserTest.testContinuousRelativeInterval sometimes fails with an off-by-one-second error:
http://ares.boundlessgeo.com/jenkins/job/geoserver-2.11.x/63/consoleText

1 2 3 4 5 6 7 8 9 Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.053 sec <<< FAILURE! testContinuousRelativeInterval(org.geoserver.ows.kvp.TimeKvpParserTest) Time elapsed: 5 sec <<< FAILURE! junit.framework.AssertionFailedError: expected:<Tue May 02 00:38:52 UTC 2017> but was:<Tue May 02 00:38:53 UTC 2017> at junit.framework.Assert.fail(Assert.java:57) at junit.framework.Assert.failNotEquals(Assert.java:329) at junit.framework.Assert.assertEquals(Assert.java:78) at junit.framework.Assert.assertEquals(Assert.java:86) at junit.framework.TestCase.assertEquals(TestCase.java:253) at org.geoserver.ows.kvp.TimeKvpParserTest.testContinuousRelativeInterval(TimeKvpParserTest.java:266)

You can make the test fail every time by wrapping each of the three continuous relative test stanzas in a big loop:

1 2 3 for (int i = 0; i < 10000000; i++) { // [...] }

Environment

None

Status

Assignee

Ben Caradoc-Davies

Reporter

Ben Caradoc-Davies

Triage

Fix versions

Affects versions

2.12-beta
2.11.1

Components

Priority

Medium
Configure