Skip to content

Commit

Permalink
testing(bigquery/storeage/managedwriter): adjust testing boundaries (#…
Browse files Browse the repository at this point in the history
…10028)

This PR gives a few of the longer-running managedwriter tests a haircut
by reducing iterations.  In many of these cases we're testing for
unusual race conditions and concurrency behaviors, so slightly longer
wall times are to be expected.

Measurement:

On my local cloudtop, `go test -race -short` for the managedwriter package
drops from ~92s to ~42s.
  • Loading branch information
shollyman committed Apr 23, 2024
1 parent bfb35e9 commit 9a69fb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bigquery/storage/managedwriter/managed_stream_test.go
Expand Up @@ -471,7 +471,7 @@ func TestManagedStream_LeakingGoroutines(t *testing.T) {

// Send a bunch of appends that expire quicker than response, and monitor that
// goroutine growth stays within bounded threshold.
for i := 0; i < 500; i++ {
for i := 0; i < 250; i++ {
expireCtx, cancel := context.WithTimeout(ctx, 25*time.Millisecond)
defer cancel()
ms.AppendRows(expireCtx, fakeData)
Expand Down Expand Up @@ -523,7 +523,7 @@ func TestManagedStream_LeakingGoroutinesReconnect(t *testing.T) {

// Send a bunch of appends that will trigger reconnects and monitor that
// goroutine growth stays within bounded threshold.
for i := 0; i < 100; i++ {
for i := 0; i < 30; i++ {
writeCtx := context.Background()
r, err := ms.AppendRows(writeCtx, fakeData)
if err != nil {
Expand Down Expand Up @@ -703,7 +703,7 @@ func TestManagedStream_RaceFinder(t *testing.T) {
}

numWriters := 5
numWrites := 50
numWrites := 15

var wg sync.WaitGroup
wg.Add(numWriters)
Expand Down

0 comments on commit 9a69fb4

Please sign in to comment.