Skip to content

Commit

Permalink
attempting to debug CI test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
mhenriks committed Aug 9, 2018
1 parent fddcf03 commit 2a9a74e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
22 changes: 13 additions & 9 deletions pkg/image/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,19 @@ func execWithLimits(command string, args ...string) ([]byte, error) {
}
defer cmd.Process.Kill()

err = setAddressSpaceLimit(cmd.Process.Pid, maxMemory)
if err != nil {
return nil, errors.Wrap(err, "Couldn't set address space limit")
}

err = setCPUTimeLimit(cmd.Process.Pid, maxCPUSecs)
if err != nil {
return nil, errors.Wrap(err, "Couldn't set CPU time limit")
}
/*
err = setAddressSpaceLimit(cmd.Process.Pid, maxMemory)
if err != nil {
return nil, errors.Wrap(err, "Couldn't set address space limit")
}
*/

/*
err = setCPUTimeLimit(cmd.Process.Pid, maxCPUSecs)
if err != nil {
return nil, errors.Wrap(err, "Couldn't set CPU time limit")
}
*/

err = cmd.Wait()
output := buf.Bytes()
Expand Down
10 changes: 5 additions & 5 deletions pkg/image/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ func TestConvertQcow2ToRawStream(t *testing.T) {
args args
wantErr bool
}{
{
name: "convert qcow2 image to Raw",
args: args{toURL(httpPort, "cirros-qcow2.img"), tempFile("cirros-test-good")},
wantErr: false,
},
{
name: "failed to convert non qcow2 image to Raw",
args: args{toURL(httpPort, "tinyCore.iso"), tempFile("cirros-test-bad")},
Expand All @@ -114,6 +109,11 @@ func TestConvertQcow2ToRawStream(t *testing.T) {
args: args{toURL(httpPort, "foobar.img"), tempFile("foobar-test-bad")},
wantErr: true,
},
{
name: "convert qcow2 image to Raw",
args: args{toURL(httpPort, "cirros-qcow2.img"), tempFile("cirros-test-good")},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 2a9a74e

Please sign in to comment.