🐛 Fix flaky assertion in climit waiting-count test

The test expected exactly one publication of the :rpc-climit-waiting
gauge inside the with-redefs window. The republisher daemon thread,
started at component init with no delay and rescheduling every 15 s,
publishes the same counter and can land inside that window, so the
recorded sequence could be [0 0] and the assertion failed with
actual [0 +0] (Backend Tests job in #12979).

Assert on the last published value instead of the whole sequence,
the contract waiting-last documents and the sibling tests use.

AI-assisted-by: inkling-2-small-free
This commit is contained in:
Andrey Antukh 2026-11-12 06:27:40 +00:00
parent e57d358c53
commit 12d73d0f63

View File

@ -445,9 +445,11 @@
(t/is (thrown? clojure.lang.ExceptionInfo
(invoke! cfg (fn [_ _] :never) {}))))
;; the count came back down instead of staying up for good
;; the count came back down instead of staying up for good. The
;; republisher daemon thread can add publications inside the window,
;; so what is asserted is the last value, not the whole sequence.
(t/is (= 0 (waiting-count climit name)))
(t/is (= [0] (waiting-value-of name)))
(t/is (= 0 (waiting-last name)))
;; and the thread dropped the mark: with it left behind, this call would
;; run inline instead of waiting for the permit another thread holds.