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 committed Sep 13, 2023
1 parent 543c399 commit 9770270
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 9770270

Please sign in to comment.