neoLegacy/tools/stress-test
2026-04-25 13:42:29 -05:00
..
README.md feat: add stress testing tool for dedicated server stability validation 2026-04-10 02:03:20 -05:00
stress_test.py perf(fourkit): server gc, fast-path event dispatch, tps probe 2026-04-24 21:31:06 -05:00
test_aggressive.bat feat: add stress testing tool for dedicated server stability validation 2026-04-10 02:03:20 -05:00
test_basic.bat feat: add stress testing tool for dedicated server stability validation 2026-04-10 02:03:20 -05:00
test_burst.bat feat: add stress testing tool for dedicated server stability validation 2026-04-10 02:03:20 -05:00
test_endurance.bat feat: add stress testing tool for dedicated server stability validation 2026-04-10 02:03:20 -05:00
test_fourkit_chunk.bat perf(fourkit): server gc, fast-path event dispatch, tps probe 2026-04-24 21:31:06 -05:00
test_fourkit_steady.bat perf(server): hold 20 TPS at 50-player scale 2026-04-25 13:42:29 -05:00
test_movement.bat feat: add stress testing tool for dedicated server stability validation 2026-04-10 02:03:20 -05:00

LCE Server Stress Test

Rapid bot connect/disconnect cycles to stress test server thread safety.

Requirements

  • Python 3.10+
  • pycryptodome (only if server has cipher enabled)
pip install pycryptodome

Usage

# Basic: 50 cycles, 8 concurrent bots, 2-10s hold time
python stress_test.py 127.0.0.1 19132

# Aggressive: rapid join/leave with short hold times
python stress_test.py 127.0.0.1 19132 --bots 12 --hold 0.5 2 --ramp 0.2

# With movement packets (tests "moved wrongly" code path)
python stress_test.py 127.0.0.1 19132 --move --hold 5 15

# Burst mode: 4 bots join simultaneously
python stress_test.py 127.0.0.1 19132 --burst 4 --hold 1 3

# Run for 5 minutes continuously
python stress_test.py 127.0.0.1 19132 --cycles 0 --duration 300

# Quiet mode (only shows stats, no per-bot messages)
python stress_test.py 127.0.0.1 19132 --quiet

What it tests

  • Player list thread safety: Rapid add/remove from the players vector
  • Socket write races: Disconnect while server is mid-write
  • Movement validation: --move flag sends position packets that trigger "moved wrongly" checks
  • Concurrent join/leave: --burst flag joins multiple bots at once

Options

Option Default Description
--bots N 8 Max concurrent bot connections
--cycles N 50 Total connect/disconnect cycles (0 = infinite)
--hold MIN MAX 2 10 Random hold time range before disconnect (seconds)
--ramp SECS 0.5 Delay between spawning bots
--move off Send movement packets while connected
--burst N 1 Bots to spawn simultaneously per cycle
--duration SECS 0 Time limit (0 = run until cycles complete)
--quiet off Only show periodic stats, not per-bot logs