spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Tests flake with error "HeadRevision mock has been called over 1 times"

Open samkim opened this issue 3 years ago • 0 comments

Example: https://github.com/authzed/spicedb/runs/5206946804?check_suite_focus=true

Relevant log snippet:

panic: 
assert: mock: The method has been called over 1 times.
	Either do one more Mock.On("HeadRevision").Return(...), or remove extra call.
	This call was unexpected:
		HeadRevision(*context.cancelCtx)
		0: &context.cancelCtx{Context:(*context.emptyCtx)(0xc0000420e8), mu:sync.Mutex{state:0, sema:0x0}, done:atomic.Value{v:interface {}(nil)}, children:map[context.canceler]struct {}(nil), err:error(nil)}
	at: [mock.go:50 hedging.go:198 asm_amd64.s:1581]

goroutine 257 [running]:
github.com/stretchr/testify/mock.(*Mock).fail(0xc000088cd0, {0xfce304, 0xa5}, {0xc0006961c0, 0x4, 0x4})
	/home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:254 +0x1eb
github.com/stretchr/testify/mock.(*Mock).MethodCalled(0xc000088cd0, {0x12101a8, 0xc}, {0xc00047ca60, 0x1, 0x1})
	/home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:399 +0x33d
github.com/stretchr/testify/mock.(*Mock).Called(0x0, {0xc00047ca60, 0x1, 0x1})
	/home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:383 +0x1a5
github.com/authzed/spicedb/internal/datastore/test.(*MockedDatastore).HeadRevision(0xc000088cd0, {0x10d9278, 0xc00038b780})
	/home/runner/work/spicedb/spicedb/internal/datastore/test/mock.go:50 +0xdc
github.com/authzed/spicedb/internal/datastore/proxy.hedgingProxy.HeadRevision.func1({0x10d9278, 0xc00038b780}, 0x65636e6143687469)
	/home/runner/work/spicedb/spicedb/internal/datastore/proxy/hedging.go:198 +0x8e
created by github.com/authzed/spicedb/internal/datastore/proxy.newHedger.func1
	/home/runner/work/spicedb/spicedb/internal/datastore/proxy/hedging.go:77 +0x308

samkim avatar Feb 15 '22 22:02 samkim