Skip to content

Commit 48e7d07

Browse files
committed
give the server a second to notice that the websocket closed
because travis is slow
1 parent 50e4f80 commit 48e7d07

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

notebook/services/kernels/tests/test_kernels_api.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,18 @@ def test_kernel_handler(self):
159159
def test_connections(self):
160160
kid = self.kern_api.start().json()['id']
161161
model = self.kern_api.get(kid).json()
162-
assert model['connections'] == 0
162+
self.assertEqual(model['connections'], 0)
163163

164164
ws = self.kern_api.websocket(kid)
165165
model = self.kern_api.get(kid).json()
166-
assert model['connections'] == 1
166+
self.assertEqual(model['connections'], 1)
167167
ws.close()
168+
# give it some time to close on the other side:
169+
for i in range(10)
170+
model = self.kern_api.get(kid).json()
171+
if model['connections'] > 0:
172+
time.sleep(0.1)
173+
else:
174+
break
168175
model = self.kern_api.get(kid).json()
169-
assert model['connections'] == 0
176+
self.assertEqual(model['connections'], 0)

0 commit comments

Comments
 (0)