diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cc0978..234ca78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,5 +14,5 @@ jobs: with: go-version: '1.19' - run: go get -t -v ./... - - run: go test -race -coverprofile=coverage.out -covermode=atomic + - run: go test -race -coverprofile=coverage.out -covermode=atomic -timeout 5s - uses: codecov/codecov-action@v3 diff --git a/melody_test.go b/melody_test.go index 653945a..d1098cf 100644 --- a/melody_test.go +++ b/melody_test.go @@ -661,6 +661,7 @@ func TestSessionKeysConcurrent(t *testing.T) { go func() { s.Set("test", TestMsg) + v1, exists := s.Get("test") assert.True(t, exists) @@ -675,6 +676,22 @@ func TestSessionKeysConcurrent(t *testing.T) { } wg.Wait() + + for i := 0; i < 100; i++ { + wg.Add(1) + + go func() { + s.UnSet("test") + + _, exists := s.Get("test") + + assert.False(t, exists) + + wg.Done() + }() + } + + wg.Wait() } func TestMisc(t *testing.T) {