Skip to content

fix(cli): isolate temporary config paths#36

Merged
phaethix merged 1 commit into
phaethix:masterfrom
floze-the-genius:fix/tempconf-unique-paths
Jul 19, 2026
Merged

fix(cli): isolate temporary config paths#36
phaethix merged 1 commit into
phaethix:masterfrom
floze-the-genius:fix/tempconf-unique-paths

Conversation

@floze-the-genius

Copy link
Copy Markdown
Contributor

Summary

Make the CLI test helper assign a unique path to every temporary config, even when parallel tests reuse the same descriptive name.

Motivation

TempConf previously keyed paths only by the caller-provided name and process ID. Reusing a name inside one test binary caused one instance to overwrite or delete another instance's file.

Closes #35.

Changes

  • append a process-local atomic ID to each TempConf path
  • add a regression covering two live configs with the same name and different contents

Compatibility Check

FerrumKV targets RESP2 / Redis semantics. If this change touches wire behaviour or command semantics:

  • This matches Redis behaviour exactly.
  • This is an intentional deviation — documented in README and asserted by a test, and tracked as a FERRUM-NNN issue.
  • N/A (no wire/semantic change).

Quality Gates — all must pass before requesting review

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-features
cargo bench --no-run --all-features
  • cargo fmt --check clean
  • cargo clippy -- -D warnings clean
  • cargo test green
  • cargo bench --no-run compiles
  • No new unsafe (or each block has a // SAFETY: justification)
  • Binary safety preserved — no String/str in the data path
  • Key-removal paths call track_remove + aof.append_del (if AOF)

Test Plan

  • confirmed the regression fails on master because both same-name instances resolve to the same path
  • cargo test temp_conf_paths_are_unique_for_reused_names -- --nocapture
  • repeated the focused regression 100 times
  • ran all four quality gates above

AI Assistance Disclosure

This pull request was implemented and validated with OpenAI Codex. The issue selection, repository policy checks, code changes, tests, and PR text were AI-assisted.

Give each TempConf instance a process-local atomic suffix so tests can safely reuse descriptive names under parallel execution. Add a regression that verifies same-name configs keep distinct paths and contents.\n\nCloses phaethix#35.
@phaethix

Copy link
Copy Markdown
Owner

Thanks for picking this up, @floze-the-genius! The atomic-id approach is exactly the fix the linked issue (#35) called for, and the added regression test is the right call. I verified it locally (fmt + clippy + full test suite all green) and will merge once CI passes. Appreciate the clean, well-scoped contribution.

@phaethix
phaethix merged commit 09ed076 into phaethix:master Jul 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: TempConf test helper derives non-unique temp filenames, causing parallel-test flakiness

2 participants