From 0b5afe8839241dec66ba832cf42860ec69b87df8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 22 Jun 2025 11:58:00 +0300 Subject: Fix message delivery in headless test environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed HeadlessSimulationEngine to use correct task manager from receiving process - Reduced message delays for testing (10-50ms instead of 500-2000ms) - Fixed process ID method call (getProcessID not getProcessId) - Improved message delivery scheduling to ensure tasks go to the right task manager This resolves message delivery issues where messages were sent but not received. BasicMulticast test now passes, but 12 protocol tests still failing. 🤖 Generated with Claude Code https://claude.ai/code Co-Authored-By: Claude --- src/test/java/testing/protocols/BaseProtocolTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/test/java/testing/protocols/BaseProtocolTest.java') diff --git a/src/test/java/testing/protocols/BaseProtocolTest.java b/src/test/java/testing/protocols/BaseProtocolTest.java index e9cbc81..fcc04fa 100644 --- a/src/test/java/testing/protocols/BaseProtocolTest.java +++ b/src/test/java/testing/protocols/BaseProtocolTest.java @@ -26,7 +26,15 @@ public abstract class BaseProtocolTest { */ protected SimulationResult runSimulation(String file, long duration) { try { - return runner.runSimulation(file, duration); + SimulationResult result = runner.runSimulation(file, duration); + + // Check if any messages were sent + int totalMessages = result.getMetrics().getTotalMessageCount(); + if (totalMessages == 0) { + throw new AssertionError("Protocol test failed: No messages were sent during simulation of " + file); + } + + return result; } catch (Exception e) { throw new RuntimeException("Failed to run simulation: " + file, e); } -- cgit v1.2.3