Repository navigation
faults/network: add packet loss fault - #7
Merged
Merged
Conversation
Second network fault for Phase 2. Mirrors the latency fault's structure deliberately: the dedup pass across the three netem-based faults comes after partition and dns failure exist, in the Fault interface stabilisation stage. Same safety contract: refuse to overwrite a user-installed qdisc, watchdog registration with heartbeat loop, idempotent revert, post-revert verification. Parameters: loss_percent (required, 0 < x <= 100) and correlation_percent (optional, 0 <= x <= 100). CLI: scorpius inject network-packet-loss with --loss, --correlation, and the same shared duration/audit/watchdog flags as network-latency.
Owner
Author
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage 1 of Phase 2 (v0.2.0). Adds
network_packet_lossas the secondnetwork fault, parallel to
network_latency. Same safety contract:refuse to overwrite a user-installed qdisc, watchdog registration with
heartbeat loop, idempotent revert, post-revert verification.
Structure deliberately mirrors
latency.gorather than extracting ashared base. The dedup pass across the three netem-based faults
(latency, packet loss, partition) is the stabilisation stage, after
partition and DNS failure are in.
internal/faults/network/packet_loss.go. Parametersloss_percent(required, 0 < x <= 100) andcorrelation_percent(optional, 0 <= x <= 100).
packet_loss_test.gomirror the latency suite(validation, qdisc-busy guard, watchdog registration, idempotent
revert, verify, dry run). Integration tests gated on
//go:build integrationexercise a real dummy interface.scorpius inject network-packet-losswith--lossand--correlationflags, plus the existing sharedduration/audit/watchdog flags.
Test plan
go vet ./...go build -tags integration ./...go test -race -count=1 ./...(unit suite, all green)sudo go test -race -count=1 -tags integration ./internal/faults/network/on a host withtc/ip(runs against adummyinterface; expected post-merge before tagging v0.2.0)