diff options
author | Adrian Villin <avillin@cisco.com> | 2024-07-10 21:57:44 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2024-07-10 22:26:39 +0000 |
commit | 63bdb319639e84a50fed0ae91f7508e95af1220e (patch) | |
tree | c2116b53ad16d27efa25bf6917e81f039083ef9e | |
parent | 3f75010dfb9c1237018450aa874967c839a76f4f (diff) |
hs-test: quick fix for CpuPinningSuite
Type: test
Change-Id: Iaed08fe23a63562c99012bd469ca3f3271be2564
Signed-off-by: Adrian Villin <avillin@cisco.com>
-rw-r--r-- | extras/hs-test/infra/cpu.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/extras/hs-test/infra/cpu.go b/extras/hs-test/infra/cpu.go index b26a06c98db..6ba60e5dfe4 100644 --- a/extras/hs-test/infra/cpu.go +++ b/extras/hs-test/infra/cpu.go @@ -39,6 +39,13 @@ func (c *CpuAllocatorT) Allocate(containerCount int, nCpus int) (*CpuContext, er // indexes, not actual cores var minCpu, maxCpu int + // temporary fix for CpuPinningSuite + if strings.Contains(CurrentSpecReport().ContainerHierarchyTexts[0], "CpuPinning") { + cpuAllocator.maxContainerCount = 1 + } else { + cpuAllocator.maxContainerCount = 4 + } + if c.runningInCi { minCpu = ((c.buildNumber) * c.maxContainerCount * nCpus) maxCpu = ((c.buildNumber + 1) * c.maxContainerCount * nCpus) - 1 @@ -130,7 +137,7 @@ func (c *CpuAllocatorT) readCpus() error { tmpCpus = iterateAndAppend(third, fourth, tmpCpus) // discard cpu 0 - if tmpCpus[0] == 0 && !*UseCpu0{ + if tmpCpus[0] == 0 && !*UseCpu0 { tmpCpus = tmpCpus[1:] } |