Increase timeout of license scan tests (#19909)

This commit is contained in:
Ella Hathaway 2024-06-17 08:52:06 -07:00 committed by GitHub
parent 8882eb09fc
commit a5b1fd3969
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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));