Skip to content

Commit

Permalink
[#479] Update watches
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillmakhonin committed Sep 28, 2018
1 parent 2a8df78 commit 96cf5e7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/python/test_k8s_watching.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,18 @@ def listener():

# Create new namespace from specification
core_api.create_namespace(new_namespace)
time.sleep(1)

self.assertIn((legion.k8s.EVENT_ADDED, TEST_ENCLAVE_NAME), events)
self.assertTrue(
legion_test.utils.wait_until(lambda: (legion.k8s.EVENT_ADDED, TEST_ENCLAVE_NAME) in events,
1, 5))

# Delete new namespace
legion.k8s.Enclave(TEST_ENCLAVE_NAME).delete(5)
time.sleep(1)
self.assertIn((legion.k8s.EVENT_MODIFIED, TEST_ENCLAVE_NAME), events)

# Wait until full deletion
time.sleep(10)
self.assertIn((legion.k8s.EVENT_DELETED, TEST_ENCLAVE_NAME), events)
self.assertTrue(
legion_test.utils.wait_until(lambda: (legion.k8s.EVENT_MODIFIED, TEST_ENCLAVE_NAME) in events,
1, 5))
self.assertTrue(
legion_test.utils.wait_until(lambda: (legion.k8s.EVENT_DELETED, TEST_ENCLAVE_NAME) in events,
1, 5))


if __name__ == '__main__':
Expand Down

0 comments on commit 96cf5e7

Please sign in to comment.