chore: remove some integration test flakiness (#8818)

Remove some integration test flakiness.

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Stefan Benz
2024-10-31 16:34:20 +01:00
committed by GitHub
parent 041af26917
commit 9422766e17
6 changed files with 68 additions and 75 deletions

View File

@@ -9,7 +9,6 @@ import (
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/zitadel/zitadel/internal/integration"
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
@@ -34,23 +33,6 @@ func TestMain(m *testing.M) {
}())
}
func await(t *testing.T, ctx context.Context, cb func(*assert.CollectT)) {
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(ctx, time.Minute)
require.EventuallyWithT(
t,
func(tt *assert.CollectT) {
defer func() {
// Panics are not recovered and don't mark the test as failed, so we need to do that ourselves
assert.Nil(tt, recover(), "panic in await callback")
}()
cb(tt)
},
retryDuration,
tick,
"awaiting successful callback failed",
)
}
var _ assert.TestingT = (*noopAssertionT)(nil)
type noopAssertionT struct{}