From cf0c9b93169f325ebf9b02f75cf145eaff393788 Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Sun, 4 Oct 2026 18:14:01 +0200 Subject: [PATCH] fleetd #719: make the foreign-id test reach a colliding sequence number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit other.sendAsync had never been called, so other's tasks map was empty and poll(ticket) returned null regardless of whether the nonce existed — the test passed against an empty map, not against a colliding id. Mint once on other so it reaches the same sequence number as the first instance, making the test exercise the actual collision the nonce guards against. --- .../src/test/java/dev/ltms/fleet/msg/MessageServiceTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fleetd/src/test/java/dev/ltms/fleet/msg/MessageServiceTest.java b/fleetd/src/test/java/dev/ltms/fleet/msg/MessageServiceTest.java index 6ef4dd6..5bc2732 100644 --- a/fleetd/src/test/java/dev/ltms/fleet/msg/MessageServiceTest.java +++ b/fleetd/src/test/java/dev/ltms/fleet/msg/MessageServiceTest.java @@ -911,6 +911,9 @@ class MessageServiceTest { void foreignInstanceTicketDoesNotResolve() { MessageService other = newIndependentInstance(); String ticket = messages.sendAsync(T, "task on first instance", null, null); + // `other` must reach the same sequence number, or this test passes against an empty map + // instead of against a colliding id. + other.sendAsync(T, "task on second instance", null, null); // control: the id resolves in the instance that minted it, so a null below cannot be // explained by broken plumbing — only by the ticket being foreign to `other`.