Simplify the condition and update the comment

This commit is contained in:
Chaoguang Lin 2021-09-02 18:51:39 -07:00
parent 3ad620b2df
commit 8622363395
1 changed files with 5 additions and 2 deletions

View File

@ -327,8 +327,11 @@ namespace SummarizeTest
Directory.GetFiles(oldBinaryFolder), Directory.GetFiles(oldBinaryFolder),
x => versionGreaterThanOrEqual(Path.GetFileName(x).Split('-').Last(), oldBinaryVersionLowerBound) x => versionGreaterThanOrEqual(Path.GetFileName(x).Split('-').Last(), oldBinaryVersionLowerBound)
&& versionLessThan(Path.GetFileName(x).Split('-').Last(), oldBinaryVersionUpperBound)); && versionLessThan(Path.GetFileName(x).Split('-').Last(), oldBinaryVersionUpperBound));
if (versionGreaterThanOrEqual(oldBinaryVersionUpperBound, getFdbserverVersion(fdbserverName))) { if (!lastFolderName.Contains("until_")) {
// only add current binary to list of old binaries if its version is less than or equal to the upperbound version // only add current binary to the list of old binaries if "until_" is not specified in the folder name
// <version> in until_<version> should be less or equal to the current binary version
// otherwise, using "until_" makes no sense
// thus, by definition, if "until_" appears, we do not want to run with the current binary version
oldBinaries = oldBinaries.Concat(currentBinary); oldBinaries = oldBinaries.Concat(currentBinary);
} }
oldServerName = random.Choice(oldBinaries.ToList<string>()); oldServerName = random.Choice(oldBinaries.ToList<string>());