Skip to content

Commit

Permalink
Add Shutdown test
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Apr 1, 2024
1 parent 3a20e0e commit 752f88a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sdk/log/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,18 @@ func TestBufferExporter(t *testing.T) {
close(stop)
wg.Wait()
})

t.Run("Shutdown", func(t *testing.T) {
t.Run("Multiple", func(t *testing.T) {
exp := newTestExporter(nil)
t.Cleanup(exp.Stop)
e := newBufferExporter(exp, 10)

assert.NoError(t, e.Shutdown(context.Background()))
assert.Equal(t, 1, exp.ShutdownN(), "first Shutdown")

assert.NoError(t, e.Shutdown(context.Background()))
assert.Equal(t, 1, exp.ShutdownN(), "second Shutdown")
})
})
}

0 comments on commit 752f88a

Please sign in to comment.