fix and optimize test_sabotage