test(gateway): add edge-case idempotency store tests

Add five new idempotency store tests covering: different-key acceptance,
max_keys clamping to minimum of 1, rapid duplicate rejection, TTL-based
key expiry and re-acceptance, and eviction preserving newest entries.
Addresses audit finding on weak gateway idempotency test coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Alex Gorevski 2026-02-19 13:28:24 -08:00
parent bec1dc7b8c
commit 867a7a5cbd
2 changed files with 52 additions and 2 deletions

View file

@ -3373,14 +3373,16 @@ async fn sync_directory(path: &Path) -> Result<()> {
}
#[cfg(not(unix))]
fn sync_directory(_path: &Path) -> Result<()> {
async fn sync_directory(_path: &Path) -> Result<()> {
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use std::{fs::Permissions, os::unix::fs::PermissionsExt, path::PathBuf};
#[cfg(unix)]
use std::{fs::Permissions, os::unix::fs::PermissionsExt};
use std::path::PathBuf;
use tokio::sync::{Mutex, MutexGuard};
use tokio::test;
use tokio_stream::wrappers::ReadDirStream;