Skip to content

tests: suite leaves logs/keel.log in CWD; next run fails test_timeline_export header tests #964

Closed

Description

@eaitbrahim

Found while reviewing PR #963. It is not caused by that PR.

What happens. A full pytest run leaves an empty logs/keel.log in the current working directory. On the next run, two tests in tests/web/test_timeline_export.py fail:

  • test_the_export_has_a_header_row_naming_provenance
  • the row_hash/chain_status header test

They fail because the CSV export's first line becomes # NOTE: the engine log could not be read (empty)….

Reproduce. Run the suite twice in a fresh git archive copy. Deleting logs/ makes it green again.

Why it matters. Back-to-back local runs go red for no reason. Mutation harnesses also report false kills: one reviewer's mutants were "killed" by this leak until it cleared logs/ before each run.

Fix. Whichever test writes the log should use tmp_path or monkeypatch.chdir. The export tests should pin their log path instead of inheriting the CWD.

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. eaitbrahim commented on Oct 12, 2026

    @eaitbrahim
    ContributorAuthor

    Found while reviewing PR #975 (round 1, O3): this also happens within a single run, not only on the next one. Start with no logs/ directory and run tests/commands/test_insights.py before tests/web in one pytest call. The CLI tests in the first file create an empty logs/keel.log in the working directory, and then the two header tests in test_timeline_export fail in the same run. The fix should cover this ordering too: any test that invokes cli must leave no logs/keel.log in the working directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions