Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flaky test ModuleEnvironmentWatcherTest #108

Open
keturn opened this issue Apr 25, 2021 · 1 comment
Open

flaky test ModuleEnvironmentWatcherTest #108

keturn opened this issue Apr 25, 2021 · 1 comment
Labels
Type: Bug Issues reporting and PRs fixing problems
Milestone

Comments

@keturn
Copy link
Member

keturn commented Apr 25, 2021

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();

@keturn keturn added Type: Bug Issues reporting and PRs fixing problems v7 labels Apr 25, 2021
@keturn keturn added this to the v7.1.0 milestone May 1, 2021
@jdrueckert jdrueckert removed the v7 label Jun 12, 2021
@soloturn
Copy link
Contributor

soloturn commented Nov 4, 2024

still fails from time to time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

No branches or pull requests

3 participants