From d3b697218773eaa5a3dd368705184726dbc0fa38 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Jun 2025 15:54:07 +0300 Subject: Implement headless testing framework for DS-Sim protocol simulations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Created HeadlessSimulationRunner that loads and runs simulations without GUI - Implemented LogCapture to intercept and store all simulation logs - Added ProtocolVerifier for flexible pattern-based log verification - Created test runners: standard, with logs, and clean (filters GUI errors) - Implemented tests for all non-Raft protocols - Added DummySimulatorFrame to satisfy GUI dependencies during loading - Created CleanHeadlessRunner that filters GUI-related errors from output - Updated run-tests.sh script with quiet mode option - Documented the framework architecture and usage The framework successfully runs protocol tests and verifies behavior through log analysis. GUI errors occur internally due to tight coupling in DS-Sim but are filtered in quiet mode for clean output. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- saved-simulations/README-raft.txt | 28 ++++++++++++++++++++++++++++ saved-simulations/raft-consensus.dat | Bin 0 -> 19962 bytes saved-simulations/raft-simple.dat | Bin 0 -> 23654 bytes saved-simulations/raft-verified.dat | Bin 0 -> 23654 bytes saved-simulations/raft-working.dat | Bin 0 -> 27595 bytes 5 files changed, 28 insertions(+) create mode 100644 saved-simulations/README-raft.txt create mode 100644 saved-simulations/raft-consensus.dat create mode 100644 saved-simulations/raft-simple.dat create mode 100644 saved-simulations/raft-verified.dat create mode 100644 saved-simulations/raft-working.dat (limited to 'saved-simulations') diff --git a/saved-simulations/README-raft.txt b/saved-simulations/README-raft.txt new file mode 100644 index 0000000..54b2059 --- /dev/null +++ b/saved-simulations/README-raft.txt @@ -0,0 +1,28 @@ +RAFT CONSENSUS SIMULATION +======================== + +This directory contains Raft consensus protocol simulations: + +1. raft-working.dat - Full working simulation with: + - 3 Raft servers (processes 0-2) + - 2 Raft clients (processes 3-4) + - Server crash/recovery events + +To run the simulation: +1. java -jar target/ds-sim-1.0.1-SNAPSHOT.jar +2. File → Open → saved-simulations/raft-working.dat +3. Click Run (▶) button + +What to look for: +- Leader election (REQUEST_VOTE messages) +- Heartbeats from leader (APPEND_ENTRIES) +- Client requests and responses +- Re-election when servers crash + +Timeline: +- Time 0: Servers start, begin leader election +- Time 500-700: Clients start +- Time 2000: Server 0 crashes +- Time 3000: Server 0 recovers +- Time 4000: Server 1 crashes +- Time 5000: Server 1 recovers diff --git a/saved-simulations/raft-consensus.dat b/saved-simulations/raft-consensus.dat new file mode 100644 index 0000000..37deac7 Binary files /dev/null and b/saved-simulations/raft-consensus.dat differ diff --git a/saved-simulations/raft-simple.dat b/saved-simulations/raft-simple.dat new file mode 100644 index 0000000..30d2c09 Binary files /dev/null and b/saved-simulations/raft-simple.dat differ diff --git a/saved-simulations/raft-verified.dat b/saved-simulations/raft-verified.dat new file mode 100644 index 0000000..763f3e7 Binary files /dev/null and b/saved-simulations/raft-verified.dat differ diff --git a/saved-simulations/raft-working.dat b/saved-simulations/raft-working.dat new file mode 100644 index 0000000..321dc84 Binary files /dev/null and b/saved-simulations/raft-working.dat differ -- cgit v1.2.3