Merge pull request 'Run the SQLite-only FTS deadlock step only on SQLite' (#227) from fix/search-deadlock-test-pg-dialect into main
This commit was merged in pull request #227.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user