fix(ops): classify hostedtoolcache ci load [metadata-only]
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m56s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m56s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
@@ -135,6 +135,7 @@ def test_counts_buildkit_runner_process_load() -> None:
|
||||
102 101 100 100 239 2.0 S docker-buildx /home/wooo/.docker/cli-plugins/docker-buildx buildx build -f apps/web/Dockerfile .
|
||||
200 150 200 200 210 12.5 S turbo turbo build --filter=@awoooi/web --concurrency=1
|
||||
201 200 200 200 200 145.0 S node node /app/apps/web/node_modules/.bin/../next/dist/bin/next build
|
||||
250 150 250 250 30 269.0 R node node /opt/hostedtoolcache/node/20.20.2/x64/bin/pnpm install --frozen-lockfile
|
||||
300 1 300 300 9999 0.1 S act_runner act_runner daemon --config /config.yaml
|
||||
400 1 400 400 120 30.0 S node node apps/web/server.js
|
||||
"""
|
||||
@@ -142,12 +143,41 @@ def test_counts_buildkit_runner_process_load() -> None:
|
||||
|
||||
load = exporter.active_gitea_action_process_load(rows)
|
||||
|
||||
assert load.group_count == 2
|
||||
assert load.process_count == 5
|
||||
assert load.cpu_percent == 160.5
|
||||
assert load.group_count == 3
|
||||
assert load.process_count == 6
|
||||
assert load.cpu_percent == 429.5
|
||||
assert load.oldest_age_seconds == 240
|
||||
|
||||
|
||||
def test_sustained_load_evidence_classifies_hostedtoolcache_pnpm_as_ci(tmp_path: Path) -> None:
|
||||
ps_file = tmp_path / "ps.txt"
|
||||
ps_file.write_text(
|
||||
"250 150 250 30 269.0 0.7 node node /opt/hostedtoolcache/node/20.20.2/x64/bin/pnpm install --frozen-lockfile\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
str(EVIDENCE_PATH),
|
||||
"--host",
|
||||
"110",
|
||||
"--ps-file",
|
||||
str(ps_file),
|
||||
"--json",
|
||||
],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
|
||||
payload = json.loads(result.stdout)
|
||||
assert payload["top_process_families"][0]["family"] == "gitea_actions_runner"
|
||||
assert payload["top_processes_sanitized"][0]["family"] == "gitea_actions_runner"
|
||||
assert "/opt/hostedtoolcache" not in result.stdout
|
||||
assert "pnpm install" not in result.stdout
|
||||
|
||||
|
||||
def test_ignores_the_host_pressure_gate_process_group() -> None:
|
||||
exporter = load_exporter()
|
||||
rows = exporter.parse_ps_rows(
|
||||
|
||||
Reference in New Issue
Block a user