fix: fix benchmark test

GitOrigin-RevId: 8cd5d90c7d7124671389cafbb89b87e6c9ced34c
This commit is contained in:
Philippe Gaultier 2025-11-20 14:13:11 +01:00 committed by ory-bot
parent 9023ef4d11
commit d0e0659136
1 changed files with 5 additions and 2 deletions

View File

@ -207,8 +207,11 @@ func ExecNoErr(t testing.TB, cmd *cobra.Command, args ...string) string {
func ExecNoErrCtx(ctx context.Context, t require.TestingT, cmd *cobra.Command, args ...string) string {
stdOut, stdErr, err := ExecCtx(ctx, cmd, nil, args...)
require.NoError(t, err, "std_out: %s\nstd_err: %s", stdOut, stdErr)
require.Len(t, stdErr, 0, stdOut)
if err == nil {
require.Len(t, stdErr, 0, "std_out: %s\nstd_err: %s", stdOut, stdErr)
} else {
require.ErrorIsf(t, err, context.Canceled, "std_out: %s\nstd_err: %s", stdOut, stdErr)
}
return stdOut
}