Repository navigation
Closed
Labels
tech-debtA chore that addresses technical debt
Description
Describe the bug
TestLiveSigstoreVerifier/with_2/3_verified_attestations occasionally fails
Affected version
PRs to trunk
Steps to reproduce the behavior
- Type this '...'
- View the output '....'
- See error
Expected vs actual behavior
Expected: pass
Actual:
windows-latest
--- FAIL: TestLiveSigstoreVerifier (3.12s)
--- FAIL: TestLiveSigstoreVerifier/with_2/3_verified_attestations (1.12s)
sigstore_integration_test.go:79:
Error Trace: D:/a/cli/cli/pkg/cmd/attestation/verification/sigstore_integration_test.go:79
Error: "[0xc00004b0f0]" should have 2 item(s), but has 1
Test: TestLiveSigstoreVerifier/with_2/3_verified_attestations
FAIL
FAIL github.com/cli/cli/v2/pkg/cmd/attestation/verification 3.468s
--- FAIL: TestVerifyAttestations (1.78s)
--- FAIL: TestVerifyAttestations/passes_verification_with_2/3_attestations_passing_Sigstore_verification (0.37s)
attestation_integration_test.go:65:
Error Trace: D:/a/cli/cli/pkg/cmd/attestation/verify/attestation_integration_test.go:65
Error: "[0xc000875820]" should have 2 item(s), but has 1
Test: TestVerifyAttestations/passes_verification_with_2/3_attestations_passing_Sigstore_verification
FAIL
FAIL github.com/cli/cli/v2/pkg/cmd/attestation/verify 12.350s
macos-latest
--- FAIL: TestVerifyAttestations (1.45s)
--- FAIL: TestVerifyAttestations/all_attestations_pass_verification (0.37s)
attestation_integration_test.go:53:
Error Trace: /Users/runner/work/cli/cli/pkg/cmd/attestation/verify/attestation_integration_test.go:53
Error: "[0xc000409e[60](https://github.com/cli/cli/actions/runs/12916504935/job/36020835039#step:5:61)]" should have 2 item(s), but has 1
Test: TestVerifyAttestations/all_attestations_pass_verification
FAIL
ubuntu-latest
--- FAIL: TestVerifyAttestations (1.32s)
--- FAIL: TestVerifyAttestations/passes_verification_with_2/3_attestations_passing_Sigstore_verification (0.26s)
attestation_integration_test.go:[65](https://github.com/cli/cli/actions/runs/12680772503/job/35343196076#step:5:66):
Error Trace: /home/runner/work/cli/cli/pkg/cmd/attestation/verify/attestation_integration_test.go:65
Error: "[0xc0009[67](https://github.com/cli/cli/actions/runs/12680772503/job/35343196076#step:5:68)ae0]" should have 2 item(s), but has 1
Test: TestVerifyAttestations/passes_verification_with_2/3_attestations_passing_Sigstore_verification
FAIL
FAIL github.com/cli/cli/v2/pkg/cmd/attestation/verify 6.048s
--- FAIL: TestVerifyAttestations (1.34s)
--- FAIL: TestVerifyAttestations/all_attestations_pass_verification (0.45s)
attestation_integration_test.go:53:
Error Trace: /home/runner/work/cli/cli/pkg/cmd/attestation/verify/attestation_integration_test.go:53
Error: "[0xc0008511f0]" should have 2 item(s), but has 1
Test: TestVerifyAttestations/all_attestations_pass_verification
FAIL
FAIL github.com/cli/cli/v2/pkg/cmd/attestation/verify 6.936s
Logs
Paste the activity from your command line. Redact if needed.
Reacted by Azeem
Metadata
Metadata
Assignees
Labels
tech-debtA chore that addresses technical debt
Activity
BagToad commentedon Feb 7, 2025
@cli/package-security for help investigating this one 🙏
iamazeem commentedon Feb 11, 2025
Getting the same error for Windows:
Workflow: https://github.com/cli/cli/actions/runs/13251671571/job/36990690943?pr=10334#step:5:61
Here's another one:
Workflow: https://github.com/cli/cli/actions/runs/13258224226/job/37008805848?pr=10413#step:5:61
2025-02-12 (Ubuntu)
Workflow: https://github.com/cli/cli/actions/runs/13288202067/job/37102016536#step:5:64
2025-02-13 (macOS)
Workflow: https://github.com/cli/cli/actions/runs/13301543234/job/37143755142?pr=10430#step:5:54
malancas commentedon Feb 12, 2025
Thanks for the report, the team is taking a look into this
malancas commentedon Feb 13, 2025
This should be resolved by #10439 but please let us know if you run into this problem again.
iamazeem commentedon Feb 14, 2025
@malancas: It's still failing:
Workflow: https://github.com/iamazeem/cli/actions/runs/13334014863/job/37244936343#step:5:60
2025-02-16 (Windows)
Workflow: https://github.com/cli/cli/actions/runs/13354330624/job/37294953903?pr=10456#step:5:59
2025-02-18 (Windows)
Workflow: https://github.com/cli/cli/actions/runs/13383511075/job/37376071790?pr=10456#step:5:59
jsoref commentedon Feb 14, 2025
And ftr https://github.com/iamazeem/cli/actions/runs/13334014863/job/37244936343#step:5:60 is https://github.com/iamazeem/cli/commits/0fb87903e5b0f11047bd65a3b93fa46a5eae8bb4 = 0fb8790 and that includes fd6ae55.
iamazeem commentedon Feb 17, 2025
UPDATE
Running tests locally on Windows 10 also reproduces this.
However, it's a bit random but overall percentage is pretty high i.e. ~80%.
Command:
Errors:
Following two JSON files are generated by running these tests:
pkg/cmd/attestation/verification/tuf-repo.github.com.jsonpkg/cmd/attestation/verification/tuf-repo-cdn.sigstore.dev.jsonand are not removed automatically.
Looks like they may be removed when the tests finish and/or added to
.gitignore.williammartin commentedon Feb 18, 2025
@iamazeem are you running in WSL? Powershell? I can't seem to reproduce this on my Parallels Windows 11 Enterprise.
For the debris files I created #10462
iamazeem commentedon Feb 18, 2025
@williammartin: I'm running these tests in Powershell on Windows 10 Home.
Besides, these tests are failing in CI pipeline also as mentioned above.
williammartin commentedon Feb 18, 2025
Sure, I'm just trying to reproduce it myself to think about fixing it. Thanks.
williammartin commentedon Feb 20, 2025
FWIW this branch contains some modifications that I believe only run 2 tests, and it fails very frequently (after I bumped the specs on my Windows VM):
williammartin commentedon Feb 20, 2025
I believe this is occurring because instantiation of the TUF Client results in a json file being written to disk via a
renameoperation, and this is not concurrent safe on Windows: https://github.com/theupdateframework/go-tuf/blob/f59c91f01f8a64466d0ecbe0cd303469615de1e9/metadata/updater/updater.go#L628Here's the error I eventually managed to get out of the tests:
From the windows godoc:
williammartin commentedon Feb 20, 2025
Some further validation, when I run the tests with
CODESPACES=true, I cannot reproduce this flake. This makes sense because this env var results in us setting a TUF client config option that results in the file writing being skipped.williammartin commentedon Feb 21, 2025
I think #10478 should resolve this but will reopen if we see these flakes reappear in CI.