fix: align boundary replay verification

This commit is contained in:
SimpleTest 2026-07-23 23:53:05 +03:00
parent e5829bcaf2
commit fdd92b51b5

View File

@ -513,6 +513,10 @@ defmodule WhoNeedHelp.ExternalBoundaryDrill do
acceptance_key = "request-accepted:#{assignment.id}:#{requester.id}" acceptance_key = "request-accepted:#{assignment.id}:#{requester.id}"
acceptance_job = wait_for_completed_job!(acceptance_key, 1) 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"] acceptance_state = state!(base_url)["push"]
assert!(acceptance_job.attempt == 1, "acceptance push was not completed on its first job run") 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" "acceptance product event targeted the wrong user"
) )
{:ok, replay_job} = {:ok, replay_notification} =
Push.enqueue_request_accepted(assignment.id, request.id, requester.id) Push.enqueue_request_accepted(assignment.id, request.id, requester.id)
assert!(replay_job.conflict?, "product event replay created a new Oban job") assert!(
assert!(replay_job.id == acceptance_job.id, "product event replay returned another job") 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) Process.sleep(250)
acceptance_replay_state = state!(base_url)["push"] acceptance_replay_state = state!(base_url)["push"]