Skip to content

Commit 0901266

Browse files
debug: minor changes in code
code Signed-off-by: Jyoti-Prakash-Muddanna <[email protected]>
1 parent 92bb138 commit 0901266

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cloud-api-adaptor/test/e2e/libvirt_common.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ func (l LibvirtAssert) VerifyPodvmConsole(t *testing.T, podvmName, expectedStrin
139139

140140
start := time.Now()
141141
duration := 3 * time.Minute
142+
maxBytes := 0
142143

143144
for time.Since(start) < duration {
144145
n, err := stream.Recv(buf)
145-
if n > 0 {
146+
if maxBytes < n {
147+
maxBytes = n
146148
output.Write(buf[:n])
147149
if len(output.String()) > len(LibvirtLog) {
148150
LibvirtLog = output.String()
@@ -154,11 +156,10 @@ func (l LibvirtAssert) VerifyPodvmConsole(t *testing.T, podvmName, expectedStrin
154156
}
155157
if err != nil && LibvirtLog != "" {
156158
t.Logf("Warning: Did not find expected String :%s in \n console :%s", expectedString, LibvirtLog)
157-
return
158159
} else if err != nil {
159160
t.Logf("Warning: Did not receive any data from console yet, err: %v", err)
160161
}
161-
time.Sleep(6 * time.Second)
162+
time.Sleep(1 * time.Second)
162163
}
163164

164165
t.Logf("Warning: Timed out waiting for expected String :%s in \n console :%s", expectedString, LibvirtLog)

0 commit comments

Comments
 (0)