Skip to content

Failing test: storage::tests::test_persistence_roundtrip (events not restored on reopen) #10

@nur-srijan

Description

@nur-srijan

Reproducer and logs:

Environment:

  • Ubuntu dev container
  • rustc 1.90.0, cargo installed via rustup

What I ran:

  • RUST_TEST_THREADS=1 cargo test storage::tests::test_persistence_roundtrip -- --nocapture

Observed:

  • The test writes a serialized state with events to a temporary path (e.g. "/tmp/.tmpfoh6AT/state.json") as shown by debug output:
    save_to_path: writing to "/tmp/.tmpfoh6AT/state.json"
    save_to_path: payload preview: {
    "events": {
    "roundtrip-session": [ ... ]
    },
    ...
    }
  • When the test reopens storage it resolves the persistence path to a different location (the current workspace), e.g.: with_path_and_format: resolved persistence path = "/workspaces/TimeLoop-Terminal/test-persistence-roundtrip"
  • Because the reopened path differs from the file actually written earlier, no events are restored and the assertion fails (events.len() == 0)

Why this matters:

  • The test expects persisted events to be restored on reopen, but the reopened persistence path does not match the file actually written earlier. This appears to be a path-handling / test mismatch (or unexpected behavior of with_path relative path resolution).

Suggested next steps for maintainers:

  • Inspect the test test_persistence_roundtrip in storage.rs — the test writes to a TempDir path (state.json in a TempDir) but later reopens Storage::with_path("test-persistence-roundtrip") which appears inconsistent.
  • Decide whether with_path should normalize/interpret relative paths differently, or update the test to reopen the same file used for initial storage (recommended).
  • Optionally add cross-checks or clearer error messages when reopening a path that doesn't contain persisted data.

Attachments / logs:

  • I can attach the test run logs if desired (they include save_to_path debug prints and the serialized payload previews).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions