Skip to content

Commit

Permalink
Reduce sleep, fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rbultman committed Aug 2, 2024
1 parent 500c024 commit 5b61ea0
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src/python_testing/TC_OpstateCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,8 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1):
countdownTime = await self.read_expect_success(endpoint=endpoint, attribute=attributes.CountdownTime)
if countdownTime is not NullValue:
self.step(5)
logging.info('Test will now collect data for 30 seconds')
time.sleep(30)
logging.info('Test will now collect data for 10 seconds')
time.sleep(10)

count = sub_handler.attribute_report_counts[attributes.CountdownTime]
sub_handler.reset()
Expand All @@ -1296,24 +1296,21 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1):

self.step(6)
countdownTime = await self.read_expect_success(endpoint=endpoint, attribute=attributes.CountdownTime)
if countdownTime is not NullValue:
attr_value = await self.read_expect_success(
endpoint=endpoint,
attribute=attributes.OperationalState)
if attr_value == cluster.Enums.OperationalStateEnum.kRunning:
self.step(7)
wait_count = 0
while (attr_value != cluster.Enums.OperationalStateEnum.kStopped) and (wait_count < 20):
time.sleep(1)
wait_count = wait_count + 1
attr_value = await self.read_expect_success(
endpoint=endpoint,
attribute=attributes.OperationalState)
count = sub_handler.attribute_report_counts[attributes.CountdownTime]
asserts.assert_less_equal(count, 5, "Received more than 5 reports for CountdownTime")
asserts.assert_greater(count, 0, "Did not receive any reports for CountdownTime")
else:
self.skip_step(7)
attr_value = await self.read_expect_success(
endpoint=endpoint,
attribute=attributes.OperationalState)
if attr_value == cluster.Enums.OperationalStateEnum.kRunning and countdownTime is not NullValue:
self.step(7)
wait_count = 0
while (attr_value != cluster.Enums.OperationalStateEnum.kStopped) and (wait_count < 20):
time.sleep(1)
wait_count = wait_count + 1
attr_value = await self.read_expect_success(
endpoint=endpoint,
attribute=attributes.OperationalState)
count = sub_handler.attribute_report_counts[attributes.CountdownTime]
asserts.assert_less_equal(count, 5, "Received more than 5 reports for CountdownTime")
asserts.assert_greater(count, 0, "Did not receive any reports for CountdownTime")
else:
self.skip_step(7)

Expand Down

0 comments on commit 5b61ea0

Please sign in to comment.