Skip to content

Commit

Permalink
[#479] Add start watch
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillmakhonin committed Oct 25, 2018
1 parent cf23439 commit d89726a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/python/test_k8s_properties_storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def listener():
events.append((event, new_data))

with legion_test.utils.ContextThread(listener):
LOGGER.info('Waiting for watch to be started and creation event')
self.assertTrue(legion_test.utils.wait_until(lambda: len(events) > 0, 1, 5),
'Creation event has not been recieved for {!r}'.format(storage_name))

LOGGER.info('Updating inside listener loop')
storage_to_write[key] = second_value
storage_to_write.save()
Expand Down Expand Up @@ -183,6 +187,10 @@ def listener():
events.append((event, new_data))

with legion_test.utils.ContextThread(listener):
LOGGER.info('Waiting for watch to be started and creation event')
self.assertTrue(legion_test.utils.wait_until(lambda: len(events) > 0, 1, 5),
'Creation event has not been recieved for {!r}'.format(storage_name))

LOGGER.info('Updating inside listener loop')
storage_to_write[key] = second_value
storage_to_write.save()
Expand Down

0 comments on commit d89726a

Please sign in to comment.