Skip to content

test(e2e): clear identities and pins between suites - #174

Merged
jamofer merged 2 commits into
mainfrom
fix/e2e-clean-state-between-suites
Aug 4, 2026
Merged

test(e2e): clear identities and pins between suites#174
jamofer merged 2 commits into
mainfrom
fix/e2e-clean-state-between-suites

Conversation

@jamofer

@jamofer jamofer commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

What

Wipe the hub, agent and client state directories when the bench sets up, so each suite starts from a clean identity world.

Why

Running the whole suite fails 3 of 56, always with the same hub message:

registration rejected: agent name pinned to a different fingerprint

Bench._reset() tears down namespaces, veths, the bridge and /etc/hosts, but never touches work_dir. The hub's TOFU pin database therefore outlives a suite. A later suite that reuses an agent name (truck42, edge) with a key from a different server's agent-state is then correctly rejected — the hub is doing exactly what it should, and the bench is lying to it.

The three failures are reconnect.robot (both WAN uplink cases) and socketcand_write_burst.robot. All three pass in isolation, which is what pointed at ordering rather than a product bug.

How

_clear_state() removes hub-state, agent-state, client-state and web.db per server at setup. logs/ is deliberately kept — it is the diagnostics for the run, and wiping the whole work_dir would delete the previous suite's logs.

Testing

  • Full suite before: 53 passed, 3 failed
  • The three failures in isolation: 4 passed, 0 failed — confirming state pollution, not a regression
  • Full suite after: 56 passed, 0 failed

Notes

Not a product defect and not a release blocker: the e2e suite is not wired into CI yet (TST-1). It does matter if e2e is ever going to be a release gate, which is why it is worth fixing now rather than filing.

Related smell left alone: every agent on a server shares one agent-state, so two agents on the same host would share an identity. No current suite does that.

@jamofer
jamofer merged commit ce501b0 into main Aug 4, 2026
11 of 12 checks passed
@jamofer
jamofer deleted the fix/e2e-clean-state-between-suites branch August 4, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant