org.terasology.gestalt.assets.module.autoreload.ModuleEnvironmentWatcherTest.test()
It sometimes passes, and sometimes on CI it does not
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:40)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:35)
at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:162)
at org.terasology.gestalt.assets.module.autoreload.ModuleEnvironmentWatcherTest.test(ModuleEnvironmentWatcherTest.java:91)
|
AssetType<Text, TextData> assetType = new AssetType<>(Text.class, new TextFactory()); |
|
watcher.register("text", subscriber, assetType); |
|
watcher.checkForChanges(); |
|
Files.createDirectories(tempDirectory.resolve("assets").resolve("text")); |
|
watcher.checkForChanges(); |
|
Files.createFile(tempDirectory.resolve("assets").resolve("text").resolve("test.txt")); |
|
SetMultimap<AssetType<?, ?>, ResourceUrn> changed = watcher.checkForChanges(); |
|
assertTrue(changed.containsEntry(assetType, new ResourceUrn(module.getId(), new Name("test.txt")))); |
|
try (Writer writer = Files.newBufferedWriter(tempDirectory.resolve("assets").resolve("text").resolve("test.txt"))) { |
|
writer.write("This is my text"); |
|
} |
|
changed = watcher.checkForChanges(); |
|
assertTrue(changed.containsEntry(assetType, new ResourceUrn(module.getId(), new Name("test.txt")))); |
|
FilesUtil.recursiveDelete(tempDirectory); |
|
watcher.checkForChanges(); |
org.terasology.gestalt.assets.module.autoreload.ModuleEnvironmentWatcherTest.test()
It sometimes passes, and sometimes on CI it does not
gestalt/gestalt-asset-core/src/test/java/org/terasology/gestalt/assets/module/autoreload/ModuleEnvironmentWatcherTest.java
Lines 84 to 98 in a7968fe