fix: align boundary replay verification
This commit is contained in:
parent
e5829bcaf2
commit
fdd92b51b5
|
|
@ -513,6 +513,10 @@ defmodule WhoNeedHelp.ExternalBoundaryDrill do
|
|||
|
||||
acceptance_key = "request-accepted:#{assignment.id}:#{requester.id}"
|
||||
acceptance_job = wait_for_completed_job!(acceptance_key, 1)
|
||||
|
||||
acceptance_record =
|
||||
Repo.get_by!(WhoNeedHelp.Notifications.Notification, idempotency_key: acceptance_key)
|
||||
|
||||
acceptance_state = state!(base_url)["push"]
|
||||
|
||||
assert!(acceptance_job.attempt == 1, "acceptance push was not completed on its first job run")
|
||||
|
|
@ -531,11 +535,16 @@ defmodule WhoNeedHelp.ExternalBoundaryDrill do
|
|||
"acceptance product event targeted the wrong user"
|
||||
)
|
||||
|
||||
{:ok, replay_job} =
|
||||
{:ok, replay_notification} =
|
||||
Push.enqueue_request_accepted(assignment.id, request.id, requester.id)
|
||||
|
||||
assert!(replay_job.conflict?, "product event replay created a new Oban job")
|
||||
assert!(replay_job.id == acceptance_job.id, "product event replay returned another job")
|
||||
assert!(
|
||||
replay_notification.id == acceptance_record.id,
|
||||
"product event replay created another notification"
|
||||
)
|
||||
|
||||
replay_job = wait_for_completed_job!(acceptance_key, 1)
|
||||
assert!(replay_job.id == acceptance_job.id, "product event replay created another Oban job")
|
||||
Process.sleep(250)
|
||||
|
||||
acceptance_replay_state = state!(base_url)["push"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user