Commit ffba4d8
test(rvagent-backends, ruvector-nervous-system): real fixes for env-flaky tests
Replaces PR ruvnet#380's band-aid threshold-tuning + matches!() broadening
with real robustness:
## rvagent-backends procfs symlink — env probe + skip-with-reason
`test_linux_proc_fd_verification` and `test_macos_f_getpath_verification`
used to accept either `PathEscapesRoot` OR `IoError` because some
kernels return `ELOOP` before the post-open verification can run.
That was a band-aid: it hid environmental differences instead of
reporting them.
Real fix: a runtime probe `proc_fd_verification_works_in_this_env()`
drives the same symlink-escape attack at test setup; if the kernel
returns `ELOOP` (FilesystemLoop) before verification fires, the test
self-skips with a clear `eprintln!` message. The assertion is now
tight: `matches!(..., PathEscapesRoot)` only.
On this sandbox the probe correctly reports the env can't exercise
the verification path; the test skips deterministically. On a normal
Linux host with full procfs access, the probe returns true and the
test exercises the real assertion.
## ruvector-nervous-system — split smoke vs perf
Six tests were asserting absolute throughput thresholds that flake
on slow CI runners (lowered in PR ruvnet#380, but still flaky):
event_bus_sustained_throughput
hdc_encoding_throughput
hdc_similarity_throughput
hopfield_retrieval_throughput
meta_learning_task_throughput
test_performance_targets (in ewc_tests.rs)
Real fix: split each into a smoke variant + a perf variant:
- **Smoke** (kept under `tests/`, runs on every `cargo test`):
asserts functional correctness only — operations > 0, gradients
finite/non-negative, output shapes match. **No throughput
assertions.** Smoke wall-time is 2s.
- **Perf** (`<name>_perf`, behind `#[cfg(feature = "perf-tests")]`):
keeps the absolute throughput thresholds. Run with
`cargo test --features perf-tests` on dedicated perf hardware.
Each shared workload extracted to a helper so smoke and perf
exercise the identical code path.
`perf-tests` feature added to `Cargo.toml`, default off.
## Verification
cargo build -p rvagent-backends → ok
cargo test -p rvagent-backends → 232 passed, 1 ignored
cargo build -p ruvector-nervous-system → ok
cargo test -p ruvector-nervous-system → 511 passed, 5 ignored
cargo test -p ruvector-nervous-system --features perf-tests → 25 passed across the
perf-test files
cargo clippy -p rvagent-backends --all-targets --no-deps -- -D warnings → exit 0
cargo clippy -p ruvector-nervous-system --all-targets --no-deps -- -D warnings → exit 0
cargo fmt --all --check → exit 0
## Files
- `crates/rvAgent/rvagent-backends/tests/security_tests.rs`
- `crates/ruvector-nervous-system/Cargo.toml` (added `perf-tests` feature)
- `crates/ruvector-nervous-system/tests/throughput.rs`
- `crates/ruvector-nervous-system/tests/ewc_tests.rs`
Co-Authored-By: claude-flow <ruv@ruv.net>1 parent 4a3d8bf commit ffba4d8
4 files changed
Lines changed: 309 additions & 60 deletions
File tree
- crates
- ruvector-nervous-system
- tests
- rvAgent/rvagent-backends/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
1 | 12 | | |
2 | 13 | | |
3 | 14 | | |
| |||
273 | 284 | | |
274 | 285 | | |
275 | 286 | | |
276 | | - | |
277 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
278 | 298 | | |
279 | 299 | | |
280 | | - | |
281 | 300 | | |
282 | 301 | | |
283 | 302 | | |
| |||
286 | 305 | | |
287 | 306 | | |
288 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
289 | 363 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | 364 | | |
294 | 365 | | |
295 | 366 | | |
296 | 367 | | |
297 | 368 | | |
298 | 369 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | 370 | | |
307 | 371 | | |
308 | 372 | | |
309 | 373 | | |
310 | 374 | | |
311 | 375 | | |
312 | 376 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | 377 | | |
319 | 378 | | |
320 | 379 | | |
| |||
0 commit comments