Skip to content

Commit 4f1b733

Browse files
committed
internal/race_test: add missing impl.LazyEnabled() t.Skip
I noticed that this test failed when turning off lazy decoding. This is an oversight: other tests, like lazy_roundtrip_test.go, already check impl.LazyEnabled(). Change-Id: Id0dc144f3888d590f1e6d705df8573e8a4071b7f Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/708555 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Chressie Himpel <chressie@google.com>
1 parent 0b2c87d commit 4f1b733

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/race_test/lazy/lazy_race_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"testing"
2626
"unsafe"
2727

28+
"google.golang.org/protobuf/internal/impl"
2829
"google.golang.org/protobuf/internal/test/race"
2930
mixedpb "google.golang.org/protobuf/internal/testprotos/mixed"
3031
testopaquepb "google.golang.org/protobuf/internal/testprotos/testeditions/testeditions_opaque"
@@ -313,6 +314,10 @@ func expandedLazy(m *testopaquepb.TestRequiredLazy) bool {
313314
// This test verifies all assumptions of TestParallellMarshalWithRequired
314315
// are (still) valid, to prevent the test from becoming a no-op (again).
315316
func TestParallellMarshalWithRequiredAssumptions(t *testing.T) {
317+
if !impl.LazyEnabled() {
318+
t.Skipf("this test requires lazy decoding to be enabled")
319+
}
320+
316321
b, err := proto.Marshal(fillRequiredLazy())
317322
if err != nil {
318323
t.Fatal(err)

0 commit comments

Comments
 (0)