migrate-kf6-seds: add 600s timeout on per-recipe cook (C-7)

Several KF6 recipes (kf6-kauth, kf6-kconfig, kf6-kwidgetsaddons)
use autotools and their `autoreconf` step can take 5+ minutes
on a clean cook. Without a per-recipe timeout, a hung cook
blocks the migration script indefinitely and leaves
`source-pristine/` snapshots lingering on disk.

The sed chain we care about runs in the recipe's [build].script
BEFORE the configure step, so a 10-minute window is plenty.
The snapshot at step 2 is already on disk, so even if the
cook is killed by the timeout, the post-cook source state
is still useful for the diff.

Adds test_cook_has_timeout regression test (123 Python tests
total). All 7 test files pass.
This commit is contained in:
2026-06-12 17:52:06 +03:00
parent 761cb2b98a
commit 07f924fe09
2 changed files with 24 additions and 1 deletions
@@ -206,6 +206,19 @@ class TestScriptStructure(unittest.TestCase):
self.assertGreater(fetch_pos, 0, "fetch not found")
self.assertLess(unfetch_pos, fetch_pos, "unfetch must come before fetch")
def test_cook_has_timeout(self):
# Some upstream KF6 recipes (kf6-kauth, kf6-kconfig,
# kf6-kwidgetsaddons) use autotools and the autoreconf
# step can take 5+ minutes. Without a timeout, a hung
# cook would block the migration script indefinitely.
# The script must apply a per-recipe timeout.
text = SCRIPT.read_text()
self.assertRegex(
text,
r'timeout\s+\d+\s+./target/release/repo\s+cook',
"cook call must be wrapped in `timeout N`",
)
if __name__ == "__main__":
unittest.main()