Skip to content

Test pyforefire and listenHTTP on FFTile/FFState; fix three crashes - #283

Open
HugoFara wants to merge 3 commits into
forefireAPI:devfrom
HugoFara:test/python-fftile-ffstate
Open

HugoFara wants to merge 3 commits into
forefireAPI:devfrom
HugoFara:test/python-fftile-ffstate

Conversation

@HugoFara

@HugoFara HugoFara commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Tests the Python bindings and listen mode on .fftile/.ffstate, as asked in #282. Both work; testing turned up three older bugs, fixed here:

  • setParameters[ForeFireDataDirectory=] segfaulted (empty value read past the argument list). tests/ffstate/smoke.py uses that line, so it crashed on Linux.
  • listenHTTP read one segment per request: a POST whose body comes after the headers got a 404 (every POST from Python's urllib).
  • A listenHTTP server started from pyforefire crashed on its first command: execute() left the kernel writing to a freed stream. Java and WASM bindings had the same pattern; all three now use one scoped guard, Command::OutputCapture.

New: tests/python/test_fftile_ffstate.py and test_listen.py, on a small synthetic tile, in invariants.yml. They fail on dev, one check per bug.

Tested: both new tests, Java binding compiled against JDK 21 (WASM left to CI, no emcc here), CTest, test_runner/test_ensemble/test_moisture_invariants, and tests/ffstate/smoke.py (synthetic tile). Not tested: Meso-NH mode=attach, real Corsica tiles.

Drafted with Claude Opus 5.5, reviewed by a human before posting.

…nHTTP crash

- setParameter[key=] read past its argument list; it now sets an empty value.
- listenHTTP read one segment per request, so a POST body sent after the
  headers got a 404. It now reads the whole request, with a size cap and a
  receive timeout.
- pyforefire's execute() left the kernel writing to a stream freed on return,
  so a listenHTTP server started from Python crashed on its first command.
Loads a synthetic tile from Python, restores checkpoints in fresh workers for
both arrival-map layouts, and drives a tile case over listenHTTP by GET and
POST. Run in CI by invariants.yml.
… too

Command::OutputCapture points command output at a caller's stream and back
to cout when it goes out of scope. The Java and WASM bindings left it on a
stream freed on return, as pyforefire did; all three now use the guard.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant