tests: fix handling failed test case