Skip to content

Commit e23c35e

Browse files
authored
fix(bpt-golden): drop parallel for resource consumption (#2826)
1 parent 4099c5f commit e23c35e

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

infra/blueprint-test/pkg/golden/golden.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2022 Google LLC
2+
* Copyright 2022-2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,14 +28,12 @@ import (
2828
"github.com/mitchellh/go-testing-interface"
2929
"github.com/stretchr/testify/assert"
3030
"github.com/tidwall/gjson"
31-
"golang.org/x/sync/errgroup"
3231
)
3332

3433
const (
3534
gfDir = "testdata"
3635
gfPerms = 0755
3736
gfUpdateEnvVar = "UPDATE_GOLDEN"
38-
gGoroutinesMax = 24
3937
)
4038

4139
type GoldenFile struct {
@@ -162,17 +160,8 @@ func (g *GoldenFile) JSONEq(a *assert.Assertions, got gjson.Result, jsonPath str
162160

163161
// JSONPathEqs asserts that json content in jsonPaths for got and goldenfile are the same
164162
func (g *GoldenFile) JSONPathEqs(a *assert.Assertions, got gjson.Result, jsonPaths []string) {
165-
syncGroup := new(errgroup.Group)
166-
syncGroup.SetLimit(gGoroutinesMax)
167-
g.t.Logf("Checking %d JSON paths with max %d goroutines", len(jsonPaths), gGoroutinesMax)
168-
for _, jsonPath := range jsonPaths {
169-
jsonPath := jsonPath
170-
syncGroup.Go(func() error {
171-
g.JSONEq(a, got, jsonPath)
172-
return nil
173-
})
174-
}
175-
if err := syncGroup.Wait(); err != nil {
176-
g.t.Fatal(err)
163+
for i, jsonPath := range jsonPaths {
164+
g.t.Logf("Checking (%d of %d) JSON paths: %s", i, len(jsonPaths), jsonPath)
165+
g.JSONEq(a, got, jsonPath)
177166
}
178167
}

0 commit comments

Comments
 (0)