Skip to content

benchmark: a foreign run's trace is deleted before the run is marked foreign #243

Description

@trifonnt

Version: main at 51c8356. scripts/benchmark/run.py.

With EXPECT_CONNECTION set, a run served by another connection is reported as a foreign finding, but its session and trace have already been deleted — so the evidence for the finding is gone, although the runner keeps traces for findings.

The cleanup in run_task decides on rec.get("foreign"):

if rec.get("network") or rec.get("lookup") or rec.get("foreign") or rec.get("substituted"):
    ...                                   # a finding: keep the session and its trace
elif os.environ.get("KEEP") != "1":
    ...                                   # delete

but rec["foreign"] is only assigned later, in one(), after run_task has returned:

rec["foreign"] = rec["connection"]

so the flag is always absent at cleanup time and the run is deleted, then printed as FINDING foreign.

Fix shape: pass the expected connection into run_task so it can set foreign before cleanup, or defer cleanup until after one() has assigned it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions