Skip to content

Sqlite test_export_sql: flaky due to hardcoded /tmp paths + no tearDown #56

Description

@eduralph

Summary

Sqlite.tests.test_sqlite.ExportSQLTestCase::test_export_sql is flaky in CI and has surfaced as a recurring T3 delta across 7+ Gramps Testbed bundles (issue_10415, issue_10628, issue_5516, issue_5965, issue_6793, issue_7344, issue_7832), in both the gramps60 and gramps61 matrix legs. The root cause appears to be hardcoded /tmp paths and no tearDown cleanup, which leaves state between runs and makes the test order-dependent.

Symptoms

  • The test is consistently unrelated to any patch under review, yet it appears as a new T3 delta, triggering a NEEDS-HUMAN sign-off item every time
  • The failure appears in both run-addon-unit-60.json and run-addon-unit-61.json matrix legs

Suggested fix

  1. Replace any hardcoded /tmp path with tempfile.mkdtemp() (or tempfile.TemporaryDirectory) to get an isolated, unique directory per run
  2. Add a tearDown (or addCleanup) to remove the temporary directory after each test, preventing state leakage between runs

Short-term mitigation

Until the test is fixed, add the test ID to known_failures in both engine/baselines/run-addon-unit-60.json and engine/baselines/run-addon-unit-61.json in the Gramps Testbed so it stops surfacing as an unexplained delta.

Context

Identified via cross-cycle Act review of the Gramps Testbed v2 PDCA harness (act-log 2026-06-27).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions