diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-21 15:54:07 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-21 15:54:07 +0300 |
| commit | d3b697218773eaa5a3dd368705184726dbc0fa38 (patch) | |
| tree | e466fb78829c957f70e88ab92651896b49120856 /saved-simulations | |
| parent | dedec9b18bafa2bcfdb05429f717f95f2236d811 (diff) | |
Implement headless testing framework for DS-Sim protocol simulations
- 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 <noreply@anthropic.com>
Diffstat (limited to 'saved-simulations')
| -rw-r--r-- | saved-simulations/README-raft.txt | 28 | ||||
| -rw-r--r-- | saved-simulations/raft-consensus.dat | bin | 0 -> 19962 bytes | |||
| -rw-r--r-- | saved-simulations/raft-simple.dat | bin | 0 -> 23654 bytes | |||
| -rw-r--r-- | saved-simulations/raft-verified.dat | bin | 0 -> 23654 bytes | |||
| -rw-r--r-- | saved-simulations/raft-working.dat | bin | 0 -> 27595 bytes |
5 files changed, 28 insertions, 0 deletions
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 Binary files differnew file mode 100644 index 0000000..37deac7 --- /dev/null +++ b/saved-simulations/raft-consensus.dat diff --git a/saved-simulations/raft-simple.dat b/saved-simulations/raft-simple.dat Binary files differnew file mode 100644 index 0000000..30d2c09 --- /dev/null +++ b/saved-simulations/raft-simple.dat diff --git a/saved-simulations/raft-verified.dat b/saved-simulations/raft-verified.dat Binary files differnew file mode 100644 index 0000000..763f3e7 --- /dev/null +++ b/saved-simulations/raft-verified.dat diff --git a/saved-simulations/raft-working.dat b/saved-simulations/raft-working.dat Binary files differnew file mode 100644 index 0000000..321dc84 --- /dev/null +++ b/saved-simulations/raft-working.dat |
