From a5ae66bf025f821747889d8ee34c8effa225bb69 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Thu, 9 Jul 2020 10:27:08 -0400 Subject: [PATCH] Intentionally slow down the long running test This allows the watchdog restoring/delayedrestart tests to function --- tests/DMAPI/LongRunning/Test.dm | 8 +++++ .../Instance/WatchdogTest.cs | 3 +- tgstation-server.sln | 31 +++++++++++++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/tests/DMAPI/LongRunning/Test.dm b/tests/DMAPI/LongRunning/Test.dm index 8930774de6..fbc808306a 100644 --- a/tests/DMAPI/LongRunning/Test.dm +++ b/tests/DMAPI/LongRunning/Test.dm @@ -1,11 +1,19 @@ /world sleep_offline = FALSE + loop_checks = FALSE /world/New() log << "Initial value of sleep_offline: [sleep_offline]" + + // Intentionally slow down startup for testing purposes + for(var/i in 1 to 10000000) + dab() TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_ULTRASAFE) StartAsync() +/proc/dab() + return + /proc/StartAsync() set waitfor = FALSE Run() diff --git a/tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs b/tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs index 31df67e745..4a7da7395d 100644 --- a/tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs +++ b/tests/Tgstation.Server.Tests/Instance/WatchdogTest.cs @@ -366,7 +366,7 @@ namespace Tgstation.Server.Tests.Instance var daemonStatus = await instanceClient.DreamDaemon.Read(cancellationToken); Assert.AreEqual(WatchdogStatus.Online, daemonStatus.Status.Value); - /* + // Try killing the DD process to ensure it gets set to the restoring state do { @@ -390,7 +390,6 @@ namespace Tgstation.Server.Tests.Instance daemonStatus = await instanceClient.DreamDaemon.Read(cancellationToken); Assert.AreEqual(WatchdogStatus.Online, daemonStatus.Status.Value); - */ } static bool KillDD(bool require) diff --git a/tgstation-server.sln b/tgstation-server.sln index c8785b067f..4c6a9078e0 100644 --- a/tgstation-server.sln +++ b/tgstation-server.sln @@ -89,12 +89,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3BB10856-AA0 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{82066812-6C73-4360-943B-B23F2F491261}" - ProjectSection(SolutionItems) = preProject - tests\DMAPI\Config.dm = tests\DMAPI\Config.dm - tests\DMAPI\install_byond.sh = tests\DMAPI\install_byond.sh - tests\DMAPI\Test.dm = tests\DMAPI\Test.dm - tests\DMAPI\travistester.dme = tests\DMAPI\travistester.dme - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "v4", "v4", "{057FAC33-CC31-4948-91C6-B0977C335890}" ProjectSection(SolutionItems) = preProject @@ -145,6 +139,28 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "v5", "v5", "{FAEAD3B5-2EAB- src\DMAPI\tgs\v5\undef.dm = src\DMAPI\tgs\v5\undef.dm EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LongRunning", "LongRunning", "{EB1DDE8C-CA6F-4BE3-947B-597CA8EABEA5}" + ProjectSection(SolutionItems) = preProject + tests\DMAPI\LongRunning\Config.dm = tests\DMAPI\LongRunning\Config.dm + tests\DMAPI\LongRunning\long_running_test.dme = tests\DMAPI\LongRunning\long_running_test.dme + tests\DMAPI\LongRunning\long_running_test_copy.dme = tests\DMAPI\LongRunning\long_running_test_copy.dme + tests\DMAPI\LongRunning\Test.dm = tests\DMAPI\LongRunning\Test.dm + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiFree", "ApiFree", "{7B8FC2AF-1B64-4A89-8480-F0FE360DC9EC}" + ProjectSection(SolutionItems) = preProject + tests\DMAPI\ApiFree\api_free.dme = tests\DMAPI\ApiFree\api_free.dme + tests\DMAPI\ApiFree\Test.dm = tests\DMAPI\ApiFree\Test.dm + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicOperation", "BasicOperation", "{F32B9514-AAD9-429D-841A-ED810FC2598C}" + ProjectSection(SolutionItems) = preProject + tests\DMAPI\BasicOperation\basic_operation_test.dme = tests\DMAPI\BasicOperation\basic_operation_test.dme + tests\DMAPI\BasicOperation\build_byond.sh = tests\DMAPI\BasicOperation\build_byond.sh + tests\DMAPI\BasicOperation\Config.dm = tests\DMAPI\BasicOperation\Config.dm + tests\DMAPI\BasicOperation\Test.dm = tests\DMAPI\BasicOperation\Test.dm + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -281,6 +297,9 @@ Global {09056964-1C74-445A-96EC-33F6DFC07916} = {316141B0-CD21-4769-A013-D53DA9B9EC09} {5CB51532-55F0-4255-B6E5-69ED5CCD14CD} = {A55C1117-5808-4AB2-BEA6-4D4A3E66A2F2} {FAEAD3B5-2EAB-465C-A9C3-E8CB6AAA7131} = {F7765A4B-021C-454E-ABB1-2AB1B85F91B4} + {EB1DDE8C-CA6F-4BE3-947B-597CA8EABEA5} = {82066812-6C73-4360-943B-B23F2F491261} + {7B8FC2AF-1B64-4A89-8480-F0FE360DC9EC} = {82066812-6C73-4360-943B-B23F2F491261} + {F32B9514-AAD9-429D-841A-ED810FC2598C} = {82066812-6C73-4360-943B-B23F2F491261} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DFD36C95-3E49-41C7-ACDB-86BAF5B18A79}