tests: fixed a test case that could fail randomly.