| 359 | |
| 360 | |
| 361 | def features(case_name, tests, events, final, rows): |
| 362 | problems = [] |
| 363 | retained = [] |
| 364 | for name, row in final.items(): |
| 365 | expected = case_name in ("explicit_write_failure", "normal_exit", "setup_uncertain") |
| 366 | expected = expected or (case_name == "exec_wrappers" and name != "failed_exec") |
| 367 | if row["marker"] != int(expected): |
| 368 | problems.append(name + ": final marker retirement incorrect") |
| 369 | if expected: |
| 370 | retained.append(str(row["pid"])) |
| 371 | for held in events[name]: |
| 372 | if held["stage"] == "exec_held" or held["stage"].endswith("_failed"): |
| 373 | if held["marker"] != 1: |
| 374 | problems.append(name + ": marker absent at " + held["stage"]) |
| 375 | expected_keys = set(tests) | {"*"} |
| 376 | if set(rows) != expected_keys: |
| 377 | problems.append("actual reducer emitted missing or synthetic runnable rows") |
| 378 | uncertain_key = "*" if case_name == "setup_uncertain" else tests[0] |
| 379 | reason = "unaccounted forked child: " + ",".join(sorted(retained)) if retained else "" |
| 380 | for key in expected_keys: |
| 381 | expected_reason = reason if key == uncertain_key else "" |
| 382 | status = "incomplete" if expected_reason else "complete" |
| 383 | row = rows.get(key) |
| 384 | if row is None or row["status"] != status or row["reason"] != expected_reason: |
| 385 | problems.append("actual reducer status/reason mismatch: " + key) |
| 386 | return problems |
| 387 | |
| 388 | |
| 389 | def run_case(root, definition, runner, tool, reducer): |