'then' must return a promise; cleanup; failing integration test