Add more robust test for onComplete