Skip to content

Commit

Permalink
refactor migration transition test
Browse files Browse the repository at this point in the history
Signed-off-by: William Henderson <[email protected]>
  • Loading branch information
w-henderson authored and jlevon committed Sep 15, 2023
1 parent dc06fe7 commit e746e82
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/py/test_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,15 @@ def test_migration_shortest_state_transition_paths():
while len(queue) > 0:
(curr, prev) = queue.popleft()
back[curr] = prev

# Intermediate states cannot be saving states, so if our current
# node is not the start state and it is a saving state, it is only
# allowed to be an end state so we don't explore its neighbours.
if curr != source and curr in saving_states:
continue

for nxt in E[curr]:
if back[nxt] is None \
and (curr == source or curr not in saving_states):
if back[nxt] is None:
queue.append((nxt, curr))

# Iterate over the states
Expand Down

0 comments on commit e746e82

Please sign in to comment.