At the start of each iteration, you should add an assertion that the current sort doesn't match sort_type to ensure that we are actually causing a change and not a no-op