Make scheduler and Master init order predictable and make unit tests wait until init is done before starting.

This commit is contained in:
Leshana
2018-02-03 02:44:51 -05:00
parent 5847319443
commit a33792e5e5
2 changed files with 9 additions and 7 deletions

View File

@@ -34,11 +34,11 @@ var/total_unit_tests = 0
world.Del()
var/said_msg = 0
while(ticker.pregame_timeleft && ticker.pregame_timeleft > 160) // Make sure the initial startup is complete.
if(ticker.pregame_timeleft < 175 && !said_msg)
while(!Master.current_runlevel) // Make sure the initial startup is complete.
if(!said_msg)
said_msg = 1
log_unit_test("Pregame Count down has started, giving it 20 seconds to finish.")
sleep(1)
log_unit_test("Waiting for subystems initilization to finish.")
stoplag(10)
world.save_mode("extended")

View File

@@ -116,10 +116,12 @@ var/global/datum/global_init/init = new ()
processScheduler = new
master_controller = new /datum/controller/game_controller()
Master.Initialize(10, FALSE)
spawn(1)
processScheduler.deferSetupFor(/datum/controller/process/ticker)
processScheduler.setup()
Master.Initialize(10, FALSE)
spawn(1)
master_controller.setup()
#if UNIT_TEST
initialize_unit_tests()