Add tests for retry of uploading and firstRun