test: use long timeout for event waits in interface_ipc_mining

bitcoin/bitcoin: PR #36862

1 minor finding

Findings

Link

[minor] · The template2 timeout can expire before its scaled pre-generation sleep

Source inspection shows that large timeout factors, including documented --timeout-factor 0, can make the template2 wait expire before its scheduled block generation, causing the functional test's non-null assertion to fail.

Location: test/functional/interface_ipc_mining.py:278 (head).

Details and suggested fix

The timeout changes from 2 * timeout_factor seconds to max(timeout_factor, 60) seconds, but wait_and_do still sleeps for 1.1 * timeout_factor seconds before calling generate. For example, with --timeout-factor 60 and prompt request execution, the wait expires after 60 seconds while generation starts after 66 seconds; the previous timeout allowed 120 seconds. feeThreshold = MAX_MONEY prevents a fee-triggered return, and the recently connected tip keeps the 20-minute minimum-difficulty fallback from intervening. The helper still generates the block afterward, but retains the returned None, so assert template2 is not None fails. The documented debugging option --timeout-factor 0 maps to 999 and has the same ordering problem.

Preserve the previous scaled timeout as a floor here, for example max(self.long_ipc_timeout, 2000.0 * self.options.timeout_factor), so the wait outlasts the deliberate sleep and leaves time for generation.


Coverage details