diff --git a/internal/store/search_deadlock_run_timing_test.go b/internal/store/search_deadlock_run_timing_test.go index d36e712..74eda07 100644 --- a/internal/store/search_deadlock_run_timing_test.go +++ b/internal/store/search_deadlock_run_timing_test.go @@ -84,21 +84,24 @@ func TestSearchDeadlockRegression(t *testing.T) { }) // 2. Content FTS scan: pred callback queries the same Store - runBounded("searchKnowledgeFTSCandidates", func() { - hits, err := st.searchKnowledgeFTSCandidates(func(d core.KnowledgeDoc) bool { - _, qerr := st.GetAccountByOwner(d.Owner) - if qerr != nil { - t.Errorf("GetAccountByOwner failed in callback: %v", qerr) + // knowledge_fts MATCH is SQLite FTS5 only; production never calls it on PostgreSQL. + if st.Dialect() == "sqlite" { + runBounded("searchKnowledgeFTSCandidates", func() { + hits, err := st.searchKnowledgeFTSCandidates(func(d core.KnowledgeDoc) bool { + _, qerr := st.GetAccountByOwner(d.Owner) + if qerr != nil { + t.Errorf("GetAccountByOwner failed in callback: %v", qerr) + } + return true + }, core.RetrievalQuery{Text: "database optimization", TopK: 5}, true) + if err != nil { + t.Errorf("searchKnowledgeFTSCandidates failed: %v", err) } - return true - }, core.RetrievalQuery{Text: "database optimization", TopK: 5}, true) - if err != nil { - t.Errorf("searchKnowledgeFTSCandidates failed: %v", err) - } - if len(hits) == 0 { - t.Errorf("expected at least 1 hit, got 0") - } - }) + if len(hits) == 0 { + t.Errorf("expected at least 1 hit, got 0") + } + }) + } // 3. Content LIKE scan: pred callback queries the same Store runBounded("searchKnowledgeLikeSharedCandidates", func() {