Skip to content

Commit

Permalink
NO-JIRA Fix intermittent test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tabish121 committed Sep 6, 2024
1 parent daba842 commit acc4151
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,6 @@ public void testBrokerCanFederateQueueIfOnlyDemandIsFromAnotherBrokerFederationS
.withOfferedCapabilities(FEDERATION_QUEUE_RECEIVER.toString());
// Should get a flow but if the link goes away quick enough the broker won't get to this before detaching.
target.expectFlow().withLinkCredit(1000).optional();
target.expectDetach().respond();

// Simulate another broker connecting as a federation instance that will create demand on
// queue "test::test" and should generate demand to the server the broker connected to
Expand Down Expand Up @@ -2508,15 +2507,19 @@ public void testBrokerCanFederateQueueIfOnlyDemandIsFromAnotherBrokerFederationS
client.remoteFlow().withLinkCredit(10).now();
client.waitForScriptToComplete(5, TimeUnit.SECONDS);

// Now force close the federation link in an unexpected way which should cause the target to
// react and close the federation connection and trigger a rebuild of state, federation links
// should normally never be deleted by user management but if it is the state needs to be
// rebuilt in order for proper demand tracking.
target.waitForScriptToComplete(5, TimeUnit.SECONDS);
target.expectDetach().respond();

client.expectDetach();
client.expectClose().respond();
client.remoteDetach().withErrorCondition("amqp:resource-deleted", "Resource deleted").later(30);
client.waitForScriptToComplete(5, TimeUnit.SECONDS);
}

target.waitForScriptToComplete(5, TimeUnit.SECONDS);
target.expectClose();
target.remoteClose().now();

target.waitForScriptToComplete(5, TimeUnit.SECONDS);
target.close();
}
Expand Down

0 comments on commit acc4151

Please sign in to comment.