Skip to content

Commit

Permalink
ovn-tester: Remove unused __iter__ and __next__ from Context.
Browse files Browse the repository at this point in the history
With the switch to asynchronous code, these methods are no longer used
and they're no longer useful. Remove.

Signed-off-by: Mark Michelson <[email protected]>
  • Loading branch information
putnopvut committed Sep 2, 2021
1 parent 768ca72 commit da7dd12
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions ovn-tester/ovn_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,6 @@ def __exit__(self, type, value, traceback):
ovn_stats.report(self.test_name, brief=self.brief_report)
log.info(f'Exiting context {self.test_name}')

def __iter__(self):
return self

def __next__(self):
now = time.perf_counter()
if self.iteration_start:
duration = now - self.iteration_start
ovn_stats.add(ITERATION_STAT_NAME, duration, failed=self.failed)
log.log(logging.WARNING if self.failed else logging.INFO,
f'Context {self.test_name}, Iteration {self.iteration}, '
f'Result: {"FAILURE" if self.failed else "SUCCESS"}')
self.failed = False
if self.test:
# exec external cmd
# self.test.exec_cmd(self.iteration, self.test_name)
pass
self.iteration_start = now
if self.iteration < self.max_iterations - 1:
self.iteration += 1
log.info(f'Context {self.test_name}, Iteration {self.iteration}')
return self.iteration
raise StopIteration

def fail(self):
self.failed = True

async def iteration_started(self, iteration):
'''Explicitly begin iteration 'n'. This is necessary when running
asynchronously since task starts and ends can overlap.'''
Expand Down

0 comments on commit da7dd12

Please sign in to comment.