Merge pull request #5540 from sfc-gh-clin/fix-where-old-binary-not-present

Return if no available old binary in the given range
This commit is contained in:
Chaoguang Lin 2021-09-03 15:19:16 -07:00 committed by GitHub
commit d6e7617043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -334,7 +334,15 @@ namespace SummarizeTest
// thus, by definition, if "until_" appears, we do not want to run with the current binary version
oldBinaries = oldBinaries.Concat(currentBinary);
}
oldServerName = random.Choice(oldBinaries.ToList<string>());
List<string> oldBinariesList = oldBinaries.ToList<string>();
if (oldBinariesList.Count == 0) {
// In theory, restarting tests are named to have at least one old binary version to run
// But if none of the provided old binaries fall in the range, we just skip the test
Console.WriteLine("No available old binary version from {0} to {1}", oldBinaryVersionLowerBound, oldBinaryVersionUpperBound);
return 0;
} else {
oldServerName = random.Choice(oldBinariesList);
}
}
else
{