Skip to content

fix(runner): error-handling & robustness (timeouts, polling, clone check)#148

Open
lfrancke wants to merge 1 commit into
mainfrom
fix/runner-error-handling
Open

fix(runner): error-handling & robustness (timeouts, polling, clone check)#148
lfrancke wants to merge 1 commit into
mainfrom
fix/runner-error-handling

Conversation

@lfrancke

Copy link
Copy Markdown
Member

Correctness / robustness fixes in the test-runner apps

  • command.py timeout returns a string, not a list — every other return path returns a list of lines; callers do for line in output: logger(line), so a timeout message was logged one character per line (exactly on the retried, long-running commands). Now returns a list.
  • Unbounded polling loops (provider_ionos.py datacenter/cluster/nodepool, provider_replicated.py running-cluster) — while state != target: sleep(5) looped forever. A stuck API state hung the Jenkins executor and prevented terminate_cluster() from running, leaking billable IONOS resources. They now honour a 30-min timeout and return True/False; create_cluster aborts (returns None) on timeout.
  • clone_git_repo() result ignored (operator-test-runner.py) — a failed clone let the run continue after the cluster was created, surfacing later as a confusing SDP-install error. Now it terminates the cluster and aborts.
  • No HTTP timeout on the per-operator tag lookup (jenkins-job-builder.py, 16× loop) — added timeout=30.
  • Unknown provider in cluster.py silently returned None/no-op — now logs and returns.
  • De-duplicated the byte-identical write_cluster_info_file() into command.py.

Verification

  • ruff check apps/ clean; all six files parse.
  • Unit-tested: the timeout path now returns a list; a wait that never reaches its target returns False at the deadline instead of looping.

Independent of the other follow-up PRs (touches the same files as the security PR but different lines).

- command.py: the TimeoutExpired path returned a bare string while every
  other path returns a list of lines; callers iterate the output, so a
  timeout message was logged one character per line. Return a list.
- provider_ionos/provider_replicated: the "wait for state" loops polled
  forever. A stuck API state hung the Jenkins executor and prevented
  terminate_cluster() from running, leaking billable cloud resources.
  They now honour a timeout (30 min) and return True/False; create_cluster
  aborts (returns None) when a wait times out.
- operator-test-runner: check clone_git_repo()'s result; on failure,
  terminate the already-created cluster and abort instead of proceeding
  into a confusing SDP-install error.
- jenkins-job-builder: add a 30s timeout to the per-operator tag lookup so
  a slow registry can't hang the whole job.
- cluster.py: log and return on an unknown provider id instead of silently
  returning None/no-op.
- Deduplicate the identical write_cluster_info_file() into command.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant