You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
arangodb: setupDB finishes the gomock controller early, so missing mock calls are never reported #4468
The deferred Finish runs when the helper returns, before the test sets any expectations. In go.uber.org/mock v0.6.0, Controller.Finish returns early when the controller is already finished (gomock/controller.go:268-273), so the t.Cleanup check that NewController registers never reports anything. As a result, a test that forgets to make an expected call still passes: missing calls in the arangodb tests are never reported.
This is the same bug as #4315 (cassandra, scylladb, dgraph), which #4358 fixes. arangodb was outside that issue's scope; this was raised in the review of #4358.
Suggested fix
Remove defer ctrl.Finish() from setupDB. gomock.NewController(t) already registers the check with t.Cleanup at the end of the test.
Then fix any test that starts failing: those are expectations that were never met and went unnoticed.
Activity