Skip to content

Commit e63b8af

Browse files
committed
Don't write zeros to stdout
BuildKite occasionally shows; > Warning: This log has exceeded the 1MB display limit. Below we are > only showing the last 1MB of output. This is because TestOOM_Isolated's dd writes 10MB of zeros to stdout. It doesn't have to be. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 972f5b3 commit e63b8af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

runtime/service_integ_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,9 +1849,11 @@ func TestOOM_Isolated(t *testing.T) {
18491849
containerd.WithSnapshotter(defaultSnapshotterName),
18501850
containerd.WithNewSnapshot("snapshot-"+vmID, image),
18511851
containerd.WithNewSpec(
1852-
oci.WithProcessArgs("/bin/dd", "if=/dev/zero", "ibs=10M"),
1853-
firecrackeroci.WithVMID(vmID),
1852+
// The container is having 2MB of memory.
18541853
oci.WithMemoryLimit(2*1024*1024),
1854+
// But the dd command allocates 10MB of data on memory, which will be OOM killed.
1855+
oci.WithProcessArgs("/bin/dd", "if=/dev/zero", "ibs=10M", "of=/dev/null"),
1856+
firecrackeroci.WithVMID(vmID),
18551857
),
18561858
)
18571859
require.NoError(t, err)

0 commit comments

Comments
 (0)