mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Make scheduler and Master init order predictable and make unit tests wait until init is done before starting.
This commit is contained in:
@@ -34,11 +34,11 @@ var/total_unit_tests = 0
|
|||||||
world.Del()
|
world.Del()
|
||||||
|
|
||||||
var/said_msg = 0
|
var/said_msg = 0
|
||||||
while(ticker.pregame_timeleft && ticker.pregame_timeleft > 160) // Make sure the initial startup is complete.
|
while(!Master.current_runlevel) // Make sure the initial startup is complete.
|
||||||
if(ticker.pregame_timeleft < 175 && !said_msg)
|
if(!said_msg)
|
||||||
said_msg = 1
|
said_msg = 1
|
||||||
log_unit_test("Pregame Count down has started, giving it 20 seconds to finish.")
|
log_unit_test("Waiting for subystems initilization to finish.")
|
||||||
sleep(1)
|
stoplag(10)
|
||||||
|
|
||||||
world.save_mode("extended")
|
world.save_mode("extended")
|
||||||
|
|
||||||
|
|||||||
@@ -116,10 +116,12 @@ var/global/datum/global_init/init = new ()
|
|||||||
|
|
||||||
processScheduler = new
|
processScheduler = new
|
||||||
master_controller = new /datum/controller/game_controller()
|
master_controller = new /datum/controller/game_controller()
|
||||||
|
|
||||||
|
processScheduler.deferSetupFor(/datum/controller/process/ticker)
|
||||||
|
processScheduler.setup()
|
||||||
Master.Initialize(10, FALSE)
|
Master.Initialize(10, FALSE)
|
||||||
spawn(1)
|
|
||||||
processScheduler.deferSetupFor(/datum/controller/process/ticker)
|
spawn(1)
|
||||||
processScheduler.setup()
|
|
||||||
master_controller.setup()
|
master_controller.setup()
|
||||||
#if UNIT_TEST
|
#if UNIT_TEST
|
||||||
initialize_unit_tests()
|
initialize_unit_tests()
|
||||||
|
|||||||
Reference in New Issue
Block a user