Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 684cd97

Browse files
yliaogoz123
authored andcommitted
Fixed test flakiness, added loop to wait for non-empty response line.
1 parent 12c7508 commit 684cd97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kubernetes/e2e_test/test_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ def test_pod_apis(self):
144144
self.assertEqual("test string 2", line)
145145
resp.write_stdin("exit\n")
146146
resp.update(timeout=5)
147-
line = resp.read_channel(ERROR_CHANNEL)
147+
while True:
148+
line = resp.read_channel(ERROR_CHANNEL)
149+
if line != '':
150+
break
151+
time.sleep(1)
148152
status = json.loads(line)
149153
self.assertEqual(status['status'], 'Success')
150154
resp.update(timeout=5)

0 commit comments

Comments
 (0)