fix(engine): headless step() is a full simulation frame; --exec can no longer hang
step() advanced animations and timers only. It never called updatePythonScenes(), which lives solely in doFrame() -- so headless Scene.update(dt) overrides never fired. That was the filed bug, but it was one of twelve omissions: the C++ scene update never ran, scene transitions never progressed or COMPLETED, and current_frame never advanced. Headless behaved measurably differently from a real frame, and any game with per-frame logic in update() was untestable. step() is now a full simulation frame: scene update, timers, Python scene update, animations, transitions (including completion), frame-time metrics, currentFrame++. Render and input stay out, deliberately -- rendering is orthogonal to the clock and costs zero simulation time (see renderScene(); a screenshot draws arbitrary state without time passing). Timers remain on simulation_time: explicit, deterministic time is the entire point of driving a headless test with step(). This exposed the deeper bug. testTimers() reads simulation_time when headless, and simulation_time is advanced ONLY by step() -- the doFrame run loop never touched it. So the headless run loop spun forever on a frozen clock: any headless script that registered a timer and did not call step() hung until killed. And a script that died during setup registered no timers, hit the auto-exit-when-no-timers path, exited 0, and was scored as a PASSING test. So headless --exec now exits when its scripts finish, nonzero if a script fell off the end without calling sys.exit(). step() is the clock; the engine cannot advance time on its own, and pretending otherwise is what produced the hang. A genuinely long-lived headless process (server, REPL host) opts in with the new --run-forever. run_tests.py additionally refuses to pass any test whose output contains a Traceback. Between the two, 82 tests that were being scored green while asserting nothing are now correctly red; they are repaired in the following commits. closes #350
This commit is contained in:
parent
c72ab22999
commit
30abb0b7ec
8 changed files with 142 additions and 4 deletions
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue