Skip to content

Commit

Permalink
Added some comments to explain the test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
trishaanand committed Dec 30, 2020
1 parent 300bcd0 commit 251bcd9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,15 @@ public void validInviteUserWhenCancelledMidWay() {
inviteUsersDTO.setRoleName(AppsmithRole.ORGANIZATION_ADMIN.getName());

// Now trigger the invite flow and cancel it almost immediately!
// NOTE : This is the main test flow. Invite would be triggered and is expected now to run
// to completion even though its timing out in 5 milli seconds.
userService.inviteUsers(inviteUsersDTO, "http://localhost:8080")
.timeout(Duration.ofMillis(5))
.subscribe();

// Before fetching any objects from the database, to avoid flaky tests, first sleep for 10 seconds. This
// ensures that we are guaranteed that the invite flow (which was cancelled in 5 ms) has run to completion
// before we fetch the org, app, pages and actions
Mono<Organization> organizationMono = Mono.just(savedOrganization.getId())
.flatMap(orgId -> {
try {
Expand Down

0 comments on commit 251bcd9

Please sign in to comment.