diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-22 11:58:00 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-22 11:58:00 +0300 |
| commit | 0b5afe8839241dec66ba832cf42860ec69b87df8 (patch) | |
| tree | e100d2d6204f8c04dc33418ae9f193fa6b1a83c2 /src/test/java/testing/protocols/BaseProtocolTest.java | |
| parent | b0fc02ce45cb51ce7c8d607d4773808cfa9b6c87 (diff) | |
Fix message delivery in headless test environment
- 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 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/testing/protocols/BaseProtocolTest.java')
| -rw-r--r-- | src/test/java/testing/protocols/BaseProtocolTest.java | 10 |
1 files changed, 9 insertions, 1 deletions
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); } |
