From ace4e334bc5fb299d2890b5e3f35dfd84ea32606 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 30 Nov 2021 16:34:52 -0500 Subject: Use test-server on CI (#2034) * #include an absolute path didn't work - because paths were taken to always be relative. * Vary what SpawnType is used, if one isn't explicitly set. * Terminate on linux if exec fails. * Use a more sophisticated sleeping mechanism. * Attempt to make CI tests to work on aarch64 debug. Small fixes. --- tools/slang-test/test-context.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'tools/slang-test/test-context.h') diff --git a/tools/slang-test/test-context.h b/tools/slang-test/test-context.h index 203005943..03b74217f 100644 --- a/tools/slang-test/test-context.h +++ b/tools/slang-test/test-context.h @@ -107,6 +107,12 @@ class TestContext /// True if can run unit tests bool canRunUnitTests() const { return options.apiOnly == false; } + /// Given a spawn type, return the final spawn type. + /// In particular we want 'Default' spawn type to vary by the environment (for example running on test server on CI) + SpawnType getFinalSpawnType(SpawnType spawnType); + + SpawnType getFinalSpawnType(); + /// Get compiler set Slang::DownstreamCompilerSet* getCompilerSet(); Slang::DownstreamCompiler* getDefaultCompiler(SlangSourceLanguage sourceLanguage); @@ -134,8 +140,18 @@ class TestContext Slang::String exeDirectoryPath; - Slang::Int timeOutInMs = 100 * 1000; - + /// Timeout time for communication over connection. + /// NOTE! If the timeout is hit, the connection will be destroyed, and then recreated. + /// For tests that compile the stdlib, if that takes this time, the stdlib will be + /// repeatedly compiled and each time fail. + /// NOTE! This timeout may be altered in the ctor for a specific target, the initializatoin + /// value is just the default. + /// + /// TODO(JS): We could split the stdlib compilation from other actions, and have timeout specific for + /// that. To do this we could have a 'compileStdLib' RPC method. + /// + /// Current default is 2 mins. + Slang::Int connectionTimeOutInMs = 2 * 60 * 1000; protected: SlangResult _createJSONRPCConnection(Slang::RefPtr& out); -- cgit v1.2.3