tags 1106316 patch
thanks

Hello.

There was already a patch called

0001-Don-t-hard-fail-on-slow-systems.-624.patch

to fix a similar problem in another test. If you were to do the same
with "TestSignDetached", which is the failing test now, I suppose you
would do as in the attached patch.

This is however different than the fix I see here:

https://github.com/sigstore/gitsign/pull/664/commits/39f7bdbc0c3b0267fa25f26f317366da7022a4af

so I hope you can determine which one is the good fix.

BTW: I tested building the package on a arm64 machine with 1 CPU, which is 
supposed
to be "slow", and the build was successful (but I only tried once). I believe 
this
issue has nothing to do with the architecture.

Thanks.
--- gitsign-0.13.0.orig/internal/fork/ietf-cms/sign_test.go
+++ gitsign-0.13.0/internal/fork/ietf-cms/sign_test.go
@@ -101,7 +101,9 @@ func TestSignDetached(t *testing.T) {
 	// check that we're including signing time attribute
 	st, err := sd2.psd.SignerInfos[0].GetSigningTimeAttribute()
 	if st.After(time.Now().Add(time.Second)) || st.Before(time.Now().Add(-time.Second)) {
-		t.Fatal("expected SigningTime to be now. Difference was", st.Sub(time.Now()))
+		if st.Sub(time.Now()) > 5 {
+			t.Fatal("expected SigningTime to be now. Difference was", st.Sub(time.Now()))
+		}
 	}
 }
 

Reply via email to