refactor: 리펙토링 진행중 의존성 gradle은 얇게 유지, 각 모듈에서 처리하고 있는 부분에 대해서 리펙토링
This commit is contained in:
+8
-2
@@ -8,6 +8,7 @@ import dev.caskeleton.messaging.api.MessageType;
|
||||
import dev.caskeleton.messaging.api.SchemaVersion;
|
||||
import dev.caskeleton.messaging.api.destination.DestinationName;
|
||||
import dev.caskeleton.messaging.reliability.OutboxCanonicalMetadata;
|
||||
import dev.caskeleton.messaging.reliability.OutboxLease;
|
||||
import dev.caskeleton.messaging.reliability.OutboxRecord;
|
||||
import dev.caskeleton.messaging.reliability.OutboxStatus;
|
||||
import dev.caskeleton.messaging.testkit.DockerAvailability;
|
||||
@@ -130,9 +131,14 @@ class OutboxPostgresIT {
|
||||
void anAmbiguousRowStaysClaimableUnderItsOriginalIdentity() {
|
||||
OutboxRecord record = record();
|
||||
appendInTransaction(record);
|
||||
repository.leaseBatch(10, Duration.ofSeconds(30), NOW);
|
||||
// Claimed rather than leased: a terminal write is checked against the lease token, so
|
||||
// `markAmbiguous` takes the lease that owns the row. The identity-keyed overload this test used
|
||||
// to call is gone, and with it the possibility of one relay writing an outcome onto a row
|
||||
// another relay currently owns.
|
||||
OutboxLease lease =
|
||||
repository.claimBatch("ambiguous-relay", 10, Duration.ofSeconds(30), NOW).getFirst();
|
||||
|
||||
repository.markAmbiguous(record.messageId(), "CONFIRM_TIMEOUT", NOW);
|
||||
repository.markAmbiguous(lease, "CONFIRM_TIMEOUT", NOW);
|
||||
|
||||
assertThat(repository.find(record.messageId()).orElseThrow().status())
|
||||
.isEqualTo(OutboxStatus.AMBIGUOUS);
|
||||
|
||||
Reference in New Issue
Block a user