fix(ci): resolve 3 CI test failures — MCP token dir, latency flakes

1. fxt MCP server tests: set XDG_CONFIG_HOME to writable temp dir
   in test helper. On CI, $HOME=/root/ but pod runs as uid 1000,
   so FileTokenStorage::new() fails reading /root/.config/.

2. risk test_hf_gate_check: remove sub-100μs latency assertion
   (correctness test, not benchmark — flaky under CPU contention).

3. ml-labeling fractional_diff: remove sub-1μs latency assertions
   from correctness tests (latency benchmark is already #[ignore]d).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-13 11:29:48 +01:00
parent eb78f078a2
commit 89c1ea7ca5

View File

@@ -1620,13 +1620,11 @@ mod tests {
/// Tests only exercise protocol handling; actual gRPC calls will return
/// transport errors which are surfaced as `isError` tool results.
async fn make_server() -> McpServer {
// Ensure the token storage directory exists so FileTokenStorage::new()
// does not fail during tests.
let config_dir = dirs::config_dir()
.unwrap_or_else(|| std::path::PathBuf::from("/tmp"))
.join("foxhunt-tli")
.join("tokens");
let _ = std::fs::create_dir_all(&config_dir);
// Point XDG_CONFIG_HOME to a writable temp dir so FileTokenStorage::new()
// works even on CI containers where $HOME may be unwritable (e.g. /root/ as uid 1000).
let tmp = std::env::temp_dir().join("fxt-test-config");
std::fs::create_dir_all(&tmp).unwrap();
std::env::set_var("XDG_CONFIG_HOME", &tmp);
let client = FoxhuntClient::connect("http://localhost:9090")
.await