Skip to content

Commit

Permalink
ID-925 Fix register-user integration test flakiness. (#1246)
Browse files Browse the repository at this point in the history
* Fix register-user integration test flakiness.
  • Loading branch information
Ghost-in-a-Jar authored Nov 20, 2023
1 parent 95ba657 commit d8e5052
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ class RegisterService(val rawlsDao: RawlsDAO, val samDao: SamDAO, val thurloeDao
def createUserWithProfile(userInfo: UserInfo, registerRequest: RegisterRequest): Future[PerRequestMessage] =
for {
registerResult <- registerUser(userInfo, registerRequest.acceptsTermsOfService)
_ <- thurloeDao.saveProfile(userInfo, registerRequest.profile)
_ <- thurloeDao.saveKeyValues(userInfo, Map("isRegistrationComplete" -> Profile.currentVersion.toString))
// We are using the equivalent value from sam registration to force the order of operations for the thurloe calls
registrationResultUserInfo = userInfo.copy(userEmail = registerResult.email.value)
_ <- thurloeDao.saveProfile(registrationResultUserInfo, registerRequest.profile)
_ <- thurloeDao.saveKeyValues(registrationResultUserInfo, Map("isRegistrationComplete" -> Profile.currentVersion.toString))
_ <- if (!registerResult.allowed) {
thurloeDao.saveKeyValues(userInfo, Map("email" -> userInfo.userEmail))
thurloeDao.saveKeyValues(registrationResultUserInfo, Map("email" -> userInfo.userEmail))
} else Future.successful()
} yield RequestComplete(StatusCodes.OK, registerResult)

Expand Down

0 comments on commit d8e5052

Please sign in to comment.