Skip to content

Commit

Permalink
[tune] fix flaky callback test (#11102)
Browse files Browse the repository at this point in the history
  • Loading branch information
krfricke authored Sep 29, 2020
1 parent 1db8376 commit 10015e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/ray/tune/tests/test_trial_runner_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def testCallbackSteps(self):
for t in trials:
self.trial_runner.add_trial(t)

self.executor.next_trial = trials[0]
self.trial_runner.step()

# Trial 1 has been started
Expand All @@ -103,6 +104,7 @@ def testCallbackSteps(self):
"trial_complete", "trial_fail"
]))

self.executor.next_trial = trials[1]
self.trial_runner.step()

# Iteration not increased yet
Expand All @@ -120,6 +122,7 @@ def testCallbackSteps(self):
{TRAINING_ITERATION: 0})

# Let the first trial save a checkpoint
self.executor.next_trial = trials[0]
trials[0].saving_to = cp
self.trial_runner.step()
self.assertEqual(self.callback.state["trial_save"]["iteration"], 2)
Expand Down

0 comments on commit 10015e6

Please sign in to comment.