Optimize screenshot delays in automated client test (#4178)

* Optimize screenshot delays

I've done multiple test runs on GitHub Actions and this seems to be as low as the timings can go while still reliably generating all of the screenshots correctly.

* Increase wait interval in waitFor to 50ms
This commit is contained in:
Alexander01998 2024-10-26 16:54:20 +02:00 committed by GitHub
parent 6c3b5d4971
commit d21566ae3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -113,7 +113,7 @@ public class FabricApiAutoTestClient implements ClientModInitializer {
{
enableDebugHud();
waitForWorldTicks(200);
takeScreenshot("in_game_overworld");
takeScreenshot("in_game_overworld", Duration.ZERO);
}
MixinEnvironment.getCurrentEnvironment().audit();
@ -147,7 +147,7 @@ public class FabricApiAutoTestClient implements ClientModInitializer {
server.runCommand("gamemode creative " + profile.getName());
waitForWorldTicks(20);
takeScreenshot("server_in_game");
takeScreenshot("server_in_game", Duration.ZERO);
{ // Test that we can enter and exit configuration
server.runCommand("debugconfig config " + profile.getName());

View file

@ -82,7 +82,7 @@ public final class FabricClientTestHelper {
}
public static void takeScreenshot(String name) {
takeScreenshot(name, Duration.ofSeconds(1));
takeScreenshot(name, Duration.ofMillis(50));
}
public static void takeScreenshot(String name, Duration delay) {
@ -200,7 +200,7 @@ public final class FabricClientTestHelper {
throw new RuntimeException("Timed out waiting for " + what);
}
waitFor(Duration.ofSeconds(1));
waitFor(Duration.ofMillis(50));
}
}