mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-09-27 08:41:13 -07:00
update.job-locks: ask the releases API when nothing was checked
The test took the release to download from GET /update/release, the kept answer of the daily check. That answer does not outlive a restart of forgectrl, and a campaign restarts it many times after update.release-check has run, so on the bench reference (image 20260923084705) the test found "not checked yet" and failed with "no release is published to download". When the kept answer was never checked, the test now asks POST /update/check itself, the way update.release-check does. PASS on the bench in the unattended queue (the check asked, 200; the download of v0.0.6 held the lease and ended; no archive left behind); forgetest's unit tests 452 OK.
This commit is contained in:
@@ -35,6 +35,10 @@ def job_locks(ctx):
|
|||||||
ev = ctx.evidence
|
ev = ctx.evidence
|
||||||
ctx.check(fc.wait_idle(timeout=30, abort=ctx.aborted), "machine not idle")
|
ctx.check(fc.wait_idle(timeout=30, abort=ctx.aborted), "machine not idle")
|
||||||
st, rel = fc.get("/update/release")
|
st, rel = fc.get("/update/release")
|
||||||
|
if st == 200 and isinstance(rel, dict) and not rel.get("checked"):
|
||||||
|
# the kept answer does not outlive a restart of the daemon: ask now
|
||||||
|
st, rel = fc.post("/update/check")
|
||||||
|
ctx.log("the release was not checked since the daemon started: POST /update/check -> %s", st)
|
||||||
ev["release"] = {k: (rel or {}).get(k) for k in ("available", "version", "bytes")} if isinstance(rel, dict) else rel
|
ev["release"] = {k: (rel or {}).get(k) for k in ("available", "version", "bytes")} if isinstance(rel, dict) else rel
|
||||||
ctx.check(st == 200 and isinstance(rel, dict) and rel.get("available"), "no release is published to download: %s", rel)
|
ctx.check(st == 200 and isinstance(rel, dict) and rel.get("available"), "no release is published to download: %s", rel)
|
||||||
had = os.path.exists(DL_FW)
|
had = os.path.exists(DL_FW)
|
||||||
|
|||||||
Reference in New Issue
Block a user