Fix unit tests (and fail miserably)
diff --git a/go/pkg/client/cas_test.go b/go/pkg/client/cas_test.go
index 6381a4c..f1bbc7a 100644
--- a/go/pkg/client/cas_test.go
+++ b/go/pkg/client/cas_test.go
@@ -686,8 +686,8 @@
for i := 0; i < 50; i++ {
eg.Go(func() error {
// Verify that we got a context cancellation error. Sometimes, the request can succeed, if the original thread takes a while to run.
- if _, _, err := c.UploadIfMissing(cCtx, input...); err != nil && !errors.Is(err, context.Canceled) {
- return fmt.Errorf("c.UploadIfMissing(ctx, input) gave error %v, expected context canceled", err)
+ if _, _, err := c.UploadIfMissing(cCtx, input...); err != nil && status.FromContextError(err).Code() != codes.Canceled {
+ return fmt.Errorf("c.UploadIfMissing(ctx, input) gave error %v (Code %v), expected context canceled", err, status.FromContextError(err).Code())
}
return nil
})