Skip to content

Commit

Permalink
test: resolve flaky config test (#1832)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 13, 2021
1 parent 9f903f6 commit db98d01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion driver/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"net/url"
"os"
"path/filepath"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -1010,7 +1011,12 @@ func TestIdentitySchemaValidation(t *testing.T) {
tmpConfig.Close()
})

go marshalAndWrite(t, ctx, tmpConfig, i)
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
marshalAndWrite(t, ctx, tmpConfig, i)
}()

select {
case <-ctx.Done():
Expand All @@ -1021,6 +1027,8 @@ func TestIdentitySchemaValidation(t *testing.T) {

assert.Contains(t, lastHook, "The changed identity schema configuration is invalid and could not be loaded.")
}

wg.Wait()
})
}

Expand Down

0 comments on commit db98d01

Please sign in to comment.