From bf8c87493dee4b27d8914b00e64e9eccd23627c2 Mon Sep 17 00:00:00 2001 From: Martin Jakobsson Date: Sun, 13 Oct 2024 17:01:04 +0200 Subject: [PATCH] Fixed broken integration tests for now --- .../scala/hexacraft/main/GameSceneTest.scala | 12 ++++++++++++ .../hexacraft/world/ServerWorldTest.scala | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/main/src/test/scala/hexacraft/main/GameSceneTest.scala b/main/src/test/scala/hexacraft/main/GameSceneTest.scala index 18b55bf6..7d591a6f 100644 --- a/main/src/test/scala/hexacraft/main/GameSceneTest.scala +++ b/main/src/test/scala/hexacraft/main/GameSceneTest.scala @@ -154,6 +154,12 @@ class GameSceneTest extends FunSuite { gameScene.tick(tickContext) Thread.sleep(20) gameScene.tick(tickContext) + Thread.sleep(20) + gameScene.tick(tickContext) + Thread.sleep(20) + gameScene.tick(tickContext) + Thread.sleep(20) + gameScene.tick(tickContext) // start listening for audio events val audioTracker = Tracker.withStorage[AudioSystem.Event] @@ -211,6 +217,12 @@ class GameSceneTest extends FunSuite { gameScene.tick(tickContext) Thread.sleep(20) gameScene.tick(tickContext) + Thread.sleep(20) + gameScene.tick(tickContext) + Thread.sleep(20) + gameScene.tick(tickContext) + Thread.sleep(20) + gameScene.tick(tickContext) // start listening for audio events val audioTracker = Tracker.withStorage[AudioSystem.Event] diff --git a/server/src/test/scala/hexacraft/world/ServerWorldTest.scala b/server/src/test/scala/hexacraft/world/ServerWorldTest.scala index e771cca4..7089cecc 100644 --- a/server/src/test/scala/hexacraft/world/ServerWorldTest.scala +++ b/server/src/test/scala/hexacraft/world/ServerWorldTest.scala @@ -77,6 +77,12 @@ class ServerWorldTest extends FunSuite { world.tick(Seq(camera), Seq(cCoords), Seq()) Thread.sleep(20) world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) // The chunk should be loaded assert(world.getChunk(cCoords).isDefined) @@ -99,6 +105,12 @@ class ServerWorldTest extends FunSuite { world.tick(Seq(camera), Seq(cCoords), Seq()) Thread.sleep(20) world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) // The chunk should be loaded assert(world.getChunk(cCoords).isDefined) @@ -132,6 +144,12 @@ class ServerWorldTest extends FunSuite { world.tick(Seq(camera), Seq(ChunkRelWorld(0, 0, 0)), Seq()) Thread.sleep(20) world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) + Thread.sleep(20) + world.tick(Seq(camera), Seq(), Seq()) assert(world.getChunk(ChunkRelWorld(0, 0, 0)).isDefined)