[test] fix race condition for gc-all-once