Skip to content

test: commands::watch::tests::filtered_reindex_* is flaky (UNIQUE constraint failed: schema_version.version) #604

Description

@ajianaz

Problem

cargo test on develop fails intermittently (about 1 in 3 full runs locally, passes in isolation):

commands::watch::tests::filtered_reindex_touches_only_matching_changed_files
src/commands/watch.rs:479:86: called `Result::unwrap()` on an `Err` value: UNIQUE constraint failed: schema_version.version
Error code 1555: A PRIMARY KEY constraint failed

IndexSession::open_at(root, ConfigSource::ProjectOnlyAt(root)) still opens the shared global index DB, so two tests initialising the schema at the same time race on schema_version. #587/#589 isolated other tests from the real data dir, but this one (added in #584) was not covered. Expected: tests use a per-test CODECORA_HOME/temp data dir, and schema init is idempotent under concurrency (INSERT OR IGNORE / transaction).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions