-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Test flake: kubernetes/e2e_test/test_client.py::TestClient::test_portforward_raw #1300
Copy link
Copy link
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/flakeCategorizes issue or PR as related to a flaky test.Categorizes issue or PR as related to a flaky test.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Description
The presubmit test_portforward_raw is flaky. Example: https://travis-ci.org/github/kubernetes-client/python/jobs/735898772
=================================== FAILURES ===================================
_______________________ TestClient.test_portforward_raw ________________________
self = <kubernetes.e2e_test.test_client.TestClient testMethod=test_portforward_raw>
def test_portforward_raw(self):
client = api_client.ApiClient(configuration=self.config)
api = core_v1_api.CoreV1Api(client)
name = 'portforward-raw-' + short_uuid()
pod_manifest = manifest_with_command(
name,
' '.join((
'((while true;do nc -l -p 1234 -e /bin/cat; done)&);',
'((while true;do nc -l -p 1235 -e /bin/cat; done)&);',
'sleep 60',
))
)
resp = api.create_namespaced_pod(body=pod_manifest,
namespace='default')
self.assertEqual(name, resp.metadata.name)
self.assertTrue(resp.status.phase)
while True:
resp = api.read_namespaced_pod(name=name,
namespace='default')
self.assertEqual(name, resp.metadata.name)
self.assertTrue(resp.status.phase)
if resp.status.phase != 'Pending':
break
time.sleep(1)
pf = portforward(api.connect_get_namespaced_pod_portforward,
name, 'default',
ports='1234,1235,1236')
self.assertTrue(pf.connected)
sock1234 = pf.socket(1234)
sock1235 = pf.socket(1235)
sock1234.setblocking(True)
sock1235.setblocking(True)
sent1234 = b'Test port 1234 forwarding...'
sent1235 = b'Test port 1235 forwarding...'
sock1234.sendall(sent1234)
sock1235.sendall(sent1235)
reply1234 = b''
reply1235 = b''
while True:
rlist = []
if sock1234.fileno() != -1:
rlist.append(sock1234)
if sock1235.fileno() != -1:
rlist.append(sock1235)
if not rlist:
break
r, _w, _x = select.select(rlist, [], [], 1)
if not r:
break
if sock1234 in r:
data = sock1234.recv(1024)
self.assertNotEqual(data, b'', "Unexpected socket close")
reply1234 += data
if sock1235 in r:
data = sock1235.recv(1024)
self.assertNotEqual(data, b'', "Unexpected socket close")
reply1235 += data
self.assertEqual(reply1234, sent1234)
E AssertionError: b'' != b'Test port 1234 forwarding...'
kubernetes/e2e_test/test_client.py:226: AssertionError
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/flakeCategorizes issue or PR as related to a flaky test.Categorizes issue or PR as related to a flaky test.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.