Fix async clear issue in test.