Skip to content

Commit

Permalink
(PDB-5745) external-query-disconnection: suppress expected stack traces
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrw committed May 30, 2024
1 parent 18e8c23 commit e31f802
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test/puppetlabs/puppetdb/query/monitor_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,19 @@
context])))))
logged-terminations (atom [])
saw-termination (promise)
handle-event #(if (-> % .getMessage (str/includes? "Terminated abandoned"))
(do
(deliver saw-termination true)
(swap! logged-terminations conj %)
false)
(tlog/notable-pdb-event? %))]
handle-event #(let [msg (.getMessage %)]
(cond
(str/includes? msg "Terminated abandoned")
(do
(deliver saw-termination true)
(swap! logged-terminations conj %)
false)

(and (str/includes? msg "FATAL: terminating connection due to administrator command")
(str/includes? msg ":cause Connection is closed"))
false

:else (tlog/notable-pdb-event? %)))]

(with-redefs [qmon/terminate-query record-term]
(with-puppetdb nil
Expand Down

0 comments on commit e31f802

Please sign in to comment.