Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
agent: increase the number of tries to online vcpus
Browse files Browse the repository at this point in the history
cpu hotplug tests fail randomly in nested environments because 1 second is
not enough for the kernel and qemu to allocate and connect the vcpus.

fixes #474

Signed-off-by: Julio Montes <julio.montes@intel.com>
  • Loading branch information
Julio Montes committed Mar 12, 2019
1 parent 58d7623 commit 30bebf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var emptyResp = &gpb.Empty{}

const onlineCPUMemWaitTime = 100 * time.Millisecond

const onlineCPUMaxTries = 10
var onlineCPUMaxTries = uint32(100)

const cpusetMode = 0644

Expand Down
6 changes: 6 additions & 0 deletions grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ func TestOnlineCPUMem(t *testing.T) {
sysfsCPUOnlinePath = "/xyz/123/rgb/abc"
sysfsMemOnlinePath = "/xyz/123/rgb/abc"

oldOnlineCPUMaxTries := onlineCPUMaxTries
onlineCPUMaxTries = 10
defer func() {
onlineCPUMaxTries = oldOnlineCPUMaxTries
}()

_, err := a.OnlineCPUMem(context.TODO(), req)
assert.Error(err, "sysfs paths do not exist")

Expand Down

0 comments on commit 30bebf5

Please sign in to comment.