As a result of a CSRS steps down then steps up, the logic of migration_recovers_unfinished_migrations.js test is affected causing the execution to hang indefinitely. Indeed, the CSRS retries to run pending chunk migrations (this is part of the balancer logic).
The test was not designed to support this case, and that is also irrelevant to its purpose. The solution is to exclude this test from being performed when the CSRS steps down.