fleetd #719: make the foreign-id test reach a colliding sequence number
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.
This commit is contained in:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user