diff --git a/pkg/storage/inmemory/backend_test.go b/pkg/storage/inmemory/backend_test.go index ebbdc7033..f47026a06 100644 --- a/pkg/storage/inmemory/backend_test.go +++ b/pkg/storage/inmemory/backend_test.go @@ -252,3 +252,17 @@ func TestLease(t *testing.T) { assert.True(t, ok, "expected b to to acquire the lease") } } + +// Concurrent calls to Put() and ListTypes() should not cause a data race. +func TestListTypes_concurrent(_ *testing.T) { + ctx := context.Background() + backend := New() + for i := 0; i < 10; i++ { + t := fmt.Sprintf("Type-%02d", i) + go backend.Put(ctx, []*databroker.Record{{ + Id: "1", + Type: t, + }}) + go backend.ListTypes(ctx) + } +}