File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
splunk_add_on_ucc_modinput_test/functional/splunk Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -263,9 +263,17 @@ def repeat_search_until(
263263 @return: SearchState object.
264264 """
265265
266+ last_state : SearchState | None = None
267+ def internal_condition_fn (state : SearchState ) -> bool :
268+ nonlocal last_state
269+ last_state = state
270+ if callable (condition_fn ):
271+ return condition_fn (state )
272+ return state .result_count > 0
273+
266274 it = self .search_probe (
267275 probe_spl = spl ,
268- verify_fn = condition_fn ,
276+ verify_fn = internal_condition_fn ,
269277 timeout = timeout ,
270278 interval = interval ,
271279 probe_name = None ,
@@ -275,5 +283,5 @@ def repeat_search_until(
275283 while True :
276284 wait = next (it )
277285 time .sleep (wait )
278- except StopIteration as si :
279- return si . value
286+ except StopIteration :
287+ return last_state
You can’t perform that action at this time.
0 commit comments