Skip to content

test: ignore the SigV4 signature in two-run stdout tests - #25

Open
noahpotti wants to merge 1 commit into
mainfrom
fix/sigv4-test-flake
Open

test: ignore the SigV4 signature in two-run stdout tests#25
noahpotti wants to merge 1 commit into
mainfrom
fix/sigv4-test-flake

Conversation

@noahpotti

Copy link
Copy Markdown
Contributor

TestQuietSilencesStderr and TestStatusNeverLeaksToStdout are flaky (geiger-sne). Both fail on main now.

Each test compares the stdout of two runs. AWS SigV4 signs with the wall clock (internal/sign/sigv4.go). When the two runs cross a second boundary, the X-Amz-Date value and the signature change. The comparison then fails.

The subject of both tests is the effect of a flag on stdout. The signature is not the subject. Both tests now remove the Authorization and X-Amz-Date values before the comparison.

TestWithoutSigningMaterialHidesOnlyTheSignature holds that helper to its limits. A different signature is not a difference. A different URL or a different command is a difference.

To make sure that the tests still catch a real fault, I made captureRun write an extra line to stdout. TestStatusNeverLeaksToStdout failed, as it must. I then ran all three tests 60 times with no failure.

This commit was part of #24, but the merge did not include it.

Gate: gofmt, vet, -race -shuffle=on, golangci-lint.

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