masaori335 opened a new pull request, #13741:
URL: https://github.com/apache/trafficserver/pull/13741
## Why
`src/iocore/cache/CacheTest.cc` is compiled into `traffic_server` and runs
only via `traffic_server -R <level>`. Three of
its tests are gated to level 2 or 3. At `-R 1`, the level the CI scripts in
`ci/` use, they return PASSED without
running. This PR is the first half of moving the cache regression tests into
the Catch2 unit tests under
`src/iocore/cache/unit_tests/`, where ctest runs them on every build.
## Scope
This is a migration only.
- No change to cache code.
- Workloads, seeds and thresholds are carried over unchanged: hit rate ≥
0.55, size within 2%, ≤ 2/20 unseen keys
admitted. The only additions are assertions where the original checked
nothing or only one side.
- Not in this PR: porting the `cache` op-sequence test and removing
`CacheTest.cc`, `P_CacheTest.h` and `RegressionSM`.
A follow-up PR does that.
## What
| Regression test | Catch2 test | Notes |
|---|---|---|
| `cache_disk_replacement_stability` | `test_cache_StripeHashTable` | The
original printed a diff and always passed. The port asserts the property it
printed: resizing one stripe moves hash-table slots only to or from that
stripe, and the resized stripe gains slots. |
| `ram_cache_lru_seen_filter` | `test_cache_RamCacheSeenFilter` | Adds a
below-threshold section, so an always-on filter fails as well. |
| `ram_cache` | `test_cache_RamCacheHitRate` | Same Zipf workload and seed
for LRU, CLFUS and S3-FIFO, plus the tuned S3-FIFO case. At 1 MB, LRU (0.5565)
and CLFUS (0.5665) sit close to the 0.55 floor. This is recorded in a comment,
not recalibrated. |
## Testing
- `ctest -R "test_cache_|test_ConfigVolumes"`: 69/69 pass on a macOS debug
build.
- Each new assertion was checked against a deliberate break, and each break
fails the matching test:
- Perturbing a second stripe's size fails `StripeHashTable`.
- Reverting the #13234 fix fails the above-threshold seen-filter section.
- Forcing the filter always on fails the below-threshold section.
- Raising the hit-rate floor fails `RamCacheHitRate`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]