From a5b1fd3969479cc194567cddea61caac805804c8 Mon Sep 17 00:00:00 2001 From: Ella Hathaway <67609881+ellahathaway@users.noreply.github.com> Date: Mon, 17 Jun 2024 08:52:06 -0700 Subject: [PATCH] Increase timeout of license scan tests (#19909) --- .../LicenseScanTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/LicenseScanTests.cs b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/LicenseScanTests.cs index d6b4ba920..852507964 100644 --- a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/LicenseScanTests.cs +++ b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/LicenseScanTests.cs @@ -144,13 +144,16 @@ public class LicenseScanTests : TestBase { Assert.NotNull(Config.LicenseScanPath); + // Indicates how long until a timeout occurs for scanning a given file + const int FileScanTimeoutSeconds = 240; + string scancodeResultsPath = Path.Combine(LogsDirectory, "scancode-results.json"); // Scancode Doc: https://scancode-toolkit.readthedocs.io/en/latest/index.html string ignoreOptions = string.Join(" ", s_ignoredFilePatterns.Select(pattern => $"--ignore {pattern}")); ExecuteHelper.ExecuteProcessValidateExitCode( "scancode", - $"--license --processes 4 --strip-root --only-findings {ignoreOptions} --json-pp {scancodeResultsPath} {Config.LicenseScanPath}", + $"--license --processes 4 --timeout {FileScanTimeoutSeconds} --strip-root --only-findings {ignoreOptions} --json-pp {scancodeResultsPath} {Config.LicenseScanPath}", OutputHelper); JsonDocument doc = JsonDocument.Parse(File.ReadAllText(scancodeResultsPath));