Skip to content

test(e2e): harden the four-validator and forge suites - #130

Open
giunatale wants to merge 8 commits into
giunatale/test/forge-chain-id-drillfrom
giunatale/test/harden-four-validator-suites
Open

giunatale wants to merge 8 commits into
giunatale/test/forge-chain-id-drillfrom
giunatale/test/harden-four-validator-suites

Conversation

@giunatale

Copy link
Copy Markdown
Contributor

Stacked on #115 to keep one stack; what it hardens is the four-validator and forge suites of #90, #91, #104, #114 and #115. It merges after #98: the fork drill's exact check on the punishment maturity across the pause needs the resume thaw #98 carries.

  • Helpers that failed the test from inside polling conditions, which stalls the wait to its timeout, have error-returning twins used in the conditions: the client status and latest height, the next sequence to send, the pending equivocations of a validator, the staking validator state.
  • The four-validator refusal watch reads a failed phase query as "no change".
  • The refusal-threshold scenario tells stake weighting from head counting: val0 self-delegates to half the bonded power first, so two validators refusing together stay under the threshold while val0 alone crosses it.
  • The fork drill records val2's punishment maturity before the fork, requires it unchanged through the pause and the refused resume, and after the passed recover-and-resume proposal requires it moved by exactly the pause.
  • Two clauses of the revision-bump drill say what they prove.
  • A stale network is removed with the containers still attached to it before a suite comes up, instead of failing silently at the next network creation.
  • The binary go build writes in the forge module is ignored.

… the refusal watch

testify runs the condition of Eventually and Never in a goroutine of its own,
so a helper that fails the test from inside one stalls the wait to its
timeout: the revision bump's 12-minute wait for the declared client to
expire, its waits on the next send sequence and on val2's second
punishment, the fork drill's wait on the recovered client's height, and the
fabricated double-sign's wait on val2's jail. Each helper polled there has
an error-returning twin now (tryClientStatus, tryClientLatestHeight,
tryNextSequenceSend, tryPendingEquivocationsOf, tryStakingValidatorState),
modelled on tryProviderValidatorConsAddr, and the conditions use the twins.

The refusal scenario's Never watch read a failed phase query, which the
phase helper reports as an empty phase, as the consumer leaving LAUNCHED; it
ignores the empty phase now.
…ario

With near-equal powers, val0 then val1 refusing sat at a quarter and a half
of the bonded power, the shares one of four and two of four validators are
under head counting as well, so a threshold that counted validators passed
both assertions. val0 now self-delegates 2100 power first, to 3100 of 6190,
half of the bonded power; val2 and val3 refuse together, two of four with
1990, under the one-third threshold, and the consumer stays launched; they
withdraw and val0 refuses alone, one of four with half, and the consumer
pauses. The scenario reads both shares from the provider's consensus set
and requires them on their sides of the threshold before acting, so a
change in the earlier scenarios' powers fails it with the numbers. val0's
node is never stopped afterwards, and the outages the later scenarios take
leave over four fifths of the power online.
…wo revision bump clauses prove

The fork drill compared jail, stake and tombstone before and after the
recovery but never read when val2's deferred punishment executes, so a
resume that moved it wrongly passed. The fork scenario records the maturity
before the fork and the time of the block the misbehaviour message paused
the consumer in (the pause lands in the message's own block); the drill
requires the maturity unchanged by the pause and by the refused resume, and
moved by exactly the pause, resume block time minus pause block time, once
the recover-and-resume proposal passes. The provider block time comes from
providerBlockTime on the base suite, the resume block from the resumed event
in the provider's block results.

Two clauses of the revision bump drill were true for the wrong reason: the
accusation check reads a queue that was empty before the recovery, and the
liveness sweep could not act in the watched window with the suite's grace
of two thirds of a 21-day unbonding period. Their comments and messages
now say what they prove: no accusation pending across the pause, and the
mismatch check not acting on the paused consumer again.
…e a suite comes up

The stale cleanup removed the named node, init and relayer containers of a
previous run and ignored the error of removing its network. A scenario's
ephemeral export or validate container, purged by a defer, outlives a run
killed while it ran, docker refuses to remove the network it is attached
to, and the name stays taken, so the next setup failed at the network's
creation. The cleanup now inspects the network, force-removes every
container still attached to it, removes the network, and fails the suite
with docker's reason if that removal fails for any reason but the network
being gone.
go build in tests/e2e/forge writes a 150 MB forge binary next to its
sources; the repository must never carry it.
@giunatale

Copy link
Copy Markdown
Contributor Author

Rebase note: setGovVotingPeriod in base_suite_test.go is a copy of #99's helper, and providerBlockTime is also defined on #113; at the rebase, keep one of each.

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