diff --git a/scripts/admin-test-env-acceptance.mjs b/scripts/admin-test-env-acceptance.mjs index 6bb27b5ea..1b6f37546 100644 --- a/scripts/admin-test-env-acceptance.mjs +++ b/scripts/admin-test-env-acceptance.mjs @@ -1029,6 +1029,10 @@ export class AcceptanceRun { present: Object.hasOwn(this.createdResources, key), value: this.createdResources[key], }])) let restoreFixture = null + // Each producer variant must create and advance its own loading, outbound and carrier facts. + // Keeping the outer run's objects here can make a later container write PICKUP_READY nodes + // to an earlier carrier task while still reporting the variant as ready. + for (const key of createdKeys) delete this.createdResources[key] this.marker = variantMarker this.context.orderDestinationType = destinationType this.context.orderFulfillmentType = fulfillmentType diff --git a/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs b/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs index 32699b741..df0841e3e 100644 --- a/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs @@ -112,6 +112,7 @@ test('only PDA-operated variants traverse real outbound and carrier nodes before } for (const key of ['phase3Customs', 'serviceCenterFlow', 'portSchedule', 'phase3OutboundDispatch', 'phase3CarrierScheduleQuery', 'phase4CarrierPickupReady']) assert.match(entry, new RegExp(`'${key}'`)) + assert.match(entry, /for \(const key of createdKeys\) delete this\.createdResources\[key\]/) assert.match(pickupChain, /shippingReady/) assert.match(entry, /carrierScheduleQueryId/) assert.match(pickupChain, /pickup\?\.marker === variantMarker/)