slsa-github-generator icon indicating copy to clipboard operation
slsa-github-generator copied to clipboard

[bug] second argument to errors.As should not be *error

Open ianlewis opened this issue 3 years ago • 4 comments

This message pops up when running unit tests.

github/oidc_test.go:237:10: second argument to errors.As should not be *error

ianlewis avatar Oct 07 '22 06:10 ianlewis

Is this just a transient error? (From the rate limiting issue?)

I tried a couple of re-runs, but haven't hit it yet

EDIT: or maybe it's a go version? That doesn't seem like it would be a rate limiting error

asraa avatar Oct 11 '22 20:10 asraa

This isn't an error per se as it doesn't stop and it's not an error in the Rekor client or anything so it shouldn't be any thing with rate limiting. It's just a log message that I think the stdlib spits out. It happens in tests and I'm not totally sure but I'm pretty sure it's not transient. I think it's just some test code that calls errors.As on an error pointer.

ianlewis avatar Oct 11 '22 21:10 ianlewis

I found the issue. It only happens on Go 1.19+ and strangely it only seems to happen in the one file oidc_test.go. Other test files use the same code and types but don't produce this error message. I'm not sure why.

I don't know why this code would trigger the error: https://github.com/slsa-framework/slsa-github-generator/blob/1f9352cda9cb1c5454adc2a2b25c05298be0d57c/github/oidc_test.go#L237-L239

But this code won't: https://github.com/slsa-framework/slsa-github-generator/blob/1f9352cda9cb1c5454adc2a2b25c05298be0d57c/internal/builders/generic/attest_test.go#L140-L142

ianlewis avatar Oct 19 '22 05:10 ianlewis

Related to:

  • #782
  • #970

ianlewis avatar Oct 19 '22 05:10 ianlewis