Skip to content

Commit

Permalink
add lock in test to avoid negative waitgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollins-axway committed Dec 12, 2023
1 parent 90c3c5d commit c2420db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/traceability/processor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package processor

import (
"context"
"sync"
"testing"

"github.com/Axway/agent-sdk/pkg/traceability/redaction"
Expand Down Expand Up @@ -42,6 +43,7 @@ var testData = []byte(`[{
}]`)

func TestNewHandler(t *testing.T) {
testLock := sync.Mutex{}
cases := map[string]struct {
data []byte
constructorErr bool
Expand All @@ -68,6 +70,9 @@ func TestNewHandler(t *testing.T) {
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
testLock.Lock()
defer testLock.Unlock()

ctx := context.WithValue(context.Background(), "test", name)

redaction.SetupGlobalRedaction(redaction.DefaultConfig())
Expand Down

0 comments on commit c2420db

Please sign in to comment.