Skip to content

Commit

Permalink
gplazma-fermi: fix last modified check in junit test
Browse files Browse the repository at this point in the history
Motivation:

The current code (givenFileUpdated())does not guarantee that
the file's mtime value actually changes, resulting occasionally
in junit test case failure.

Modification:

Use a wait/sleep loop to check the value of the mtime and
exit when it is different.

Result:

Should no longer encounter this test case failure.

Target: master
Request: 4.1
Request: 4.0
Request: 3.2
Request: 3.1
Request: 3.0
Request: 2.16
Acked-by: Paul
Acked-by: Dmitry
  • Loading branch information
alrossi committed Apr 6, 2018
1 parent d2ae92d commit 2a5f421
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -68,6 +68,7 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import org.dcache.auth.FQANPrincipal;
import org.dcache.auth.GidPrincipal;
Expand All @@ -89,6 +90,7 @@ public class VOGroupPluginTest {
public void setUp() throws Exception {
URL url = ClassLoader.getSystemResource(TEST_FIXTURE);
file = new File(url.toURI());
file.setLastModified(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1));
map = new FileBackedVOGroupMap(file.getAbsolutePath());
plugin = new VOGroupPlugin(map);
}
Expand Down

0 comments on commit 2a5f421

Please sign in to comment.