fix(tests): complete migration to content-based stubbing in functional tests
All checks were successful
CI Code / Check spelling (pull_request) Successful in 20s
CI Code / Check coding style (pull_request) Successful in 34s
CI Code / Linux (ubuntu) (pull_request) Successful in 1h7m38s
CI Code / Linux (debian) (pull_request) Successful in 1h7m54s
CI Code / Linux (arch) (pull_request) Successful in 1h8m1s

This commit is contained in:
2026-01-06 19:54:36 +03:00
parent 0a37dd3fe8
commit 737309c888
3 changed files with 5 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ Historically the functional test suite relied on stabber's id based helpers like
* Reordering internal requests produced hard-to-debug race conditions when an `id` no longer matched.
* Parallel additions of new features could shift which stanzas received a given id causing unrelated test failures.
We are incrementally migrating to content based stubbing using direct sends (`stbbr_send`) and query hooks (`stbbr_for_query`). Instead of tying a response to a predicted id we now send the required server stanzas explicitly after initiating actions. Example (see `tests/functionaltests/proftest.c`):
We have migrated to content based stubbing using direct sends (`stbbr_send`) and query hooks (`stbbr_for_query`). Instead of tying a response to a predicted id we now send the required server stanzas explicitly after initiating actions. Example (see `tests/functionaltests/proftest.c`):
```c
// Old brittle approach
@@ -170,5 +170,5 @@ Guidelines when writing new functional tests:
4. Keep assertions tolerant of ordering when possible; rely on `prof_output_regex()` matches rather than hard-coded positions.
5. If timing flakiness appears, temporarily raise `prof_timeout()` around the critical expectation and reset it immediately afterwards.
During the migration it's acceptable for a test file to mix old and new styles; opportunistically refactor brittle sections when touching a test for other reasons.
The migration from `stbbr_for_id` is complete. All functional tests now use content-based stubbing. When adding new tests, follow the guidelines above.