Skip to content

Commit f832f39

Browse files
authored
Merge pull request #88 from joesturge/joesturge-patch-1
fix: unexpected state test
2 parents 3871ee2 + 132cfc3 commit f832f39

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

tests/bats/legacy-forge/legacy-forge.bats

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ load ../util.bash
55
project="./tests/bats/legacy-forge"
66

77
@test "Legacy Forge - Test lazymc stops server when idle" {
8+
# restart the lazymc container
9+
restart_container lazymc-legacy-forge
10+
11+
# reset the start timestamp
12+
reset_timestamp
13+
14+
#
15+
# The above steps ensures that the containers are in a clean state
16+
#
17+
818
# wait for lazymc process to start
919
wait_for_formatted_log "lazymc-legacy-forge" "INFO" "lazymc-docker-proxy::entrypoint" "Starting lazymc process for group: mc..."
1020

tests/bats/multi-server/multi-server.bats

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ load ../util.bash
55
project="./tests/bats/multi-server"
66

77
@test "Multiple Servers - Test primary and secondary servers stop when idle" {
8+
# restart the lazymc container
9+
restart_container lazymc-multi-server
10+
11+
# reset the start timestamp
12+
reset_timestamp
13+
14+
#
15+
# The above steps ensures that the containers are in a clean state
16+
#
17+
818
# wait for primary lazymc process to start
919
wait_for_formatted_log "lazymc-multi-server" "INFO" "lazymc-docker-proxy::entrypoint" "Starting lazymc process for group: primary..."
1020

tests/bats/unexpected-server-state-recovery/unexpected-server-state-recovery.bats

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ project="./tests/bats/unexpected-server-state-recovery"
3333
# wait for the mincraft server to be ready
3434
wait_for_log "mc-unexpected-server-state-recovery" "RCON running on 0.0.0.0:25575" 300
3535

36+
wait_for_formatted_log "lazymc-unexpected-server-state-recovery" "INFO" "mc::lazymc::monitor" "Server is now online"
37+
3638
# start the client container to make lazymc want to shutdown the server
3739
start_container mc-client-unexpected-server-state-recovery
3840

@@ -43,7 +45,7 @@ project="./tests/bats/unexpected-server-state-recovery"
4345
stop_container mc-client-unexpected-server-state-recovery
4446

4547
# wait for lazymc to be in an unexpected state
46-
wait_for_formatted_log "lazymc-unexpected-server-state-recovery" "WARN" "mc::lazymc" "Failed to stop server, no more suitable stopping method to use" 120
48+
wait_for_formatted_log "lazymc-unexpected-server-state-recovery" "WARN" "mc::lazymc" "Failed to stop server, no more suitable stopping method to use" 300
4749

4850
# wait for lazymc-docker-proxy to detect the server is in an unexpected state
4951
wait_for_formatted_log "lazymc-unexpected-server-state-recovery" "WARN" "lazymc-docker-proxy::entrypoint" "Unexpected server state detected, force stopping mc server container..."

tests/bats/vanilla/vanilla.bats

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ load ../util.bash
55
project="./tests/bats/vanilla"
66

77
@test "Vanilla - Test lazymc stops server when idle" {
8+
# restart the lazymc container
9+
restart_container lazymc-vanilla
10+
11+
# reset the start timestamp
12+
reset_timestamp
13+
14+
#
15+
# The above steps ensures that the containers are in a clean state
16+
#
17+
818
# wait for lazymc process to start
919
wait_for_formatted_log "lazymc-vanilla" "INFO" "lazymc-docker-proxy::entrypoint" "Starting lazymc process for group: mc..."
1020

0 commit comments

Comments
 (0)