Fix tests to properly wait for all responses before finishing