| 216 | |
| 217 | |
| 218 | def failed_native(context, case): |
| 219 | registry = context.registry(case) |
| 220 | process, destination = context.collect(case, registry, fault=True) |
| 221 | fault = json_read(case / "native-fault.json") |
| 222 | children = fault.get("children", []) |
| 223 | require(len(children) == 1, "native failure boundary was not reached (missing integration on baseline)") |
| 224 | child = children[0] |
| 225 | require(child.get("argv") == [context.runner, SUITE] and child.get("rlimit_nofile") == 7 |
| 226 | and child.get("start_new_session") is True, "native fault custody boundary changed") |
| 227 | if not isinstance(child.get("exit"), int) or child["exit"] <= 0: |
| 228 | raise Infrastructure("fixed native RLIMIT_NOFILE=7 failure precondition unmet; no tuning/retry") |
| 229 | raw = retained_profiles(destination) |
| 230 | parents = [path for path in raw if path.name == TESTS[0] + ".parent.profraw"] |
| 231 | if len(parents) != 1: |
| 232 | raise Infrastructure("native fixed fault failed before genuine first-parent evidence existed") |
| 233 | actual = convert(context, parents[0], "failed-native-parent-text") |
| 234 | require(set(actual) == set(context.universe), "native failure parent universe changed") |
| 235 | require(any(any(values) for values in actual.values()), "failed native parent has no observed counters") |
| 236 | require(process["exit"] == 1, "native suite failure must publish conservative bundle and exit1") |
| 237 | rows, _, _ = bundle(context, destination, registry, TESTS, "failed", child["exit"]) |
| 238 | require(all(b"suite_failed" in reasons for reasons, _ in rows.values()), |
| 239 | "failed native suite rows lost failure reason") |
| 240 | return {"native_exit": child["exit"], "fault": fault, "genuine_parent": str(parents[0]), |
| 241 | "bundle": str(destination), "all_rows_incomplete": True} |