Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyfedorov2 committed Aug 1, 2024
1 parent baae08d commit 224e6f8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,21 +549,21 @@ private static bool TryGetCgroupRequestCpu(IFileSystem fileSystem, out float cpu
if (cpuPodWeightBuffer.IsEmpty || (cpuPodWeightBuffer.Length == 2 && cpuPodWeightBuffer[0] == '-' && cpuPodWeightBuffer[1] == '1'))
{
Throw.InvalidOperationException(
$"Could not parse CPU weight content. Expected to find CPU weight but got '{new string(cpuPodWeightBuffer)}' instead.");
$"Could not parse '{_cpuPodWeight}' content. Expected to find CPU weight but got '{new string(cpuPodWeightBuffer)}' instead.");
}

_ = GetNextNumber(cpuPodWeightBuffer, out long cpuPodWeight);

if (cpuPodWeight == -1)
{
Throw.InvalidOperationException(
$"Could not parse CPU weight content. Expected to get an integer but got: '{cpuPodWeight}'.");
$"Could not parse '{_cpuPodWeight}' content. Expected to get an integer but got: '{cpuPodWeight}'.");
}

if (cpuPodWeight < CpuPodWeightPossibleMin || cpuPodWeight > CpuPodWeightPossibleMax)
{
Throw.ArgumentOutOfRangeException(
$"Expected to parse CPU weight in range [{CpuPodWeightPossibleMin}-{CpuPodWeightPossibleMax}], but got '{cpuPodWeight}' instead.");
$"Expected to find CPU weight in range [{CpuPodWeightPossibleMin}-{CpuPodWeightPossibleMax}] in '{_cpuPodWeight}', but got '{cpuPodWeight}' instead.");
}

// The formula to calculate CPU pod weight (measured in millicores) from CPU share:
Expand Down

0 comments on commit 224e6f8

Please sign in to comment.