Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/add_inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Test_AddInventoryItems(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 600*time.Second) // Set hard limit of 10 minutes
defer cancelFn()

stack := makeStack(t, ctx, &stackOpts{dbLogs: true, appLogs: true}) // Modify logging options as required
stack := makeStack(t, ctx, &stackOpts{dbLogs: false, appLogs: true, debug: false}) // Modify logging options as required

// 4) Create Client
baseURL := stack.app.url()
Expand Down
11 changes: 7 additions & 4 deletions integration/concurrent_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package integration
import (
"context"
"fmt"
"math/rand/v2"
"sync"
"sync/atomic"
"testing"
Expand All @@ -20,10 +21,10 @@ func Test_ConcurrentWrite(t *testing.T) {
ctx := context.Background()

// Raise stack
stack := makeStack(t, ctx, &stackOpts{dbLogs: false, appLogs: true})
stack := makeStack(t, ctx, &stackOpts{dbLogs: false, appLogs: true, debug: false})
baseURL := stack.app.url()
// Make client pool
poolSize := 10
poolSize := max(1, rand.IntN(10))
clients := make(chan *client.Client, poolSize)
for range poolSize {
cl := makeClient(t, baseURL, stack.app.authPsswd)
Expand All @@ -33,7 +34,7 @@ func Test_ConcurrentWrite(t *testing.T) {
var mu sync.Mutex

errG, gCtx := errgroup.WithContext(ctx)
errG.SetLimit(poolSize)
// errG.SetLimit(poolSize)

// Execute write test

Expand Down Expand Up @@ -62,8 +63,10 @@ func Test_ConcurrentWrite(t *testing.T) {
t.Fatal(err)
}

dur := duration.Load()

// Log stats
t.Logf("Wrote %d items, avg write time %.2fms", itemCount, float64(duration.Load())/float64(itemCount)/1e6)
t.Logf("Wrote %d items in %vs, avg write time %.2fms", itemCount, float64(dur)/1e9, float64(dur)/float64(itemCount)/1e6)

// Check items have been added

Expand Down
2 changes: 1 addition & 1 deletion integration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ func createCheckoutAppContainer(t *testing.T,
ctx context.Context,
net *testcontainers.DockerNetwork,
pg *pgContainer,
debugLogs bool,
withLogger bool,
debugLogs bool,
) *appContainer {
logLevel := "info"
if debugLogs {
Expand Down