fix: count bg lines in k6 so SIGINT-interrupted iterations do not fail the check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+15
-13
@@ -389,6 +389,9 @@ class Profile:
|
||||
("read", 50),
|
||||
)
|
||||
reconcile_downloads: int = 5000
|
||||
# предел VU сценария фоновой нагрузки (MAX_VUS background.js): им же
|
||||
# ограничено число итераций, прерванных остановкой SIGINT
|
||||
reconcile_bg_max_vus: int = 600
|
||||
reconcile_quiet_s: int = 30
|
||||
reconcile_fill_processes: int = 3
|
||||
reconcile_fill_threads: int = 24
|
||||
@@ -6417,6 +6420,7 @@ class Bench:
|
||||
"WRITE_RATE": rates["write"],
|
||||
"READ_RATE": rates["read"],
|
||||
"DURATION": "6h",
|
||||
"MAX_VUS": p.reconcile_bg_max_vus,
|
||||
"NAME": "h4-k6",
|
||||
},
|
||||
log_name,
|
||||
@@ -6463,19 +6467,17 @@ class Bench:
|
||||
),
|
||||
)
|
||||
k6_data = json.loads(summary.read_text(encoding="utf-8"))
|
||||
for kind, scenario in reconcile.SCENARIOS.items():
|
||||
iterations = (
|
||||
k6_data["metrics"]
|
||||
.get(f"iterations{{scenario:{scenario}}}", {})
|
||||
.get("values", {})
|
||||
.get("count")
|
||||
)
|
||||
lines = sum(1 for r in requests if r.kind == kind)
|
||||
if iterations != lines:
|
||||
raise BenchError(
|
||||
f"{stage}: {lines} k6 lines of {scenario}, {iterations} "
|
||||
"iterations",
|
||||
)
|
||||
problems, interrupted = reconcile.line_problems(
|
||||
requests,
|
||||
k6_data,
|
||||
max_vus=p.reconcile_bg_max_vus,
|
||||
)
|
||||
self.results.meta["reconcile"].setdefault("bg_interrupted", {})[
|
||||
stage
|
||||
] = interrupted
|
||||
self.results.write_meta()
|
||||
if problems:
|
||||
raise BenchError(f"{stage}: " + "; ".join(problems))
|
||||
for entry, result in done:
|
||||
bounds = {
|
||||
"before": (result["started_at"] - quiet, result["started_at"]),
|
||||
|
||||
Reference in New Issue
Block a user