mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-16 02:42:55 +00:00
chore: correct require usage to assert for eventual consistency (#8795)
# Which Problems Are Solved
Eventual consistency is handled wrongly in the newly improved
integration tests.
# How the Problems Are Solved
Correct the usage of the require package with the assert package where
necessary, to remove the panics where the EventuallyWithT functions can
rerun.
# Additional Changes
Modify the timeout values for some EventuallyWithT which can vary when a
instance is freshly setup.
# Additional Context
None
(cherry picked from commit fca6b28a97
)
This commit is contained in:

committed by
Livio Spring

parent
63a9312a8e
commit
27ab1a22e7
@@ -53,14 +53,16 @@ func TestServer_GetSecuritySettings(t *testing.T) {
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(tt.ctx, 20*time.Second)
|
||||
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(tt.ctx, time.Minute)
|
||||
assert.EventuallyWithT(t, func(ct *assert.CollectT) {
|
||||
resp, err := Client.GetSecuritySettings(tt.ctx, &settings.GetSecuritySettingsRequest{})
|
||||
if tt.wantErr {
|
||||
require.Error(ct, err)
|
||||
assert.Error(ct, err)
|
||||
return
|
||||
}
|
||||
if !assert.NoError(ct, err) {
|
||||
return
|
||||
}
|
||||
require.NoError(ct, err)
|
||||
got, want := resp.GetSettings(), tt.want.GetSettings()
|
||||
assert.Equal(ct, want.GetEmbeddedIframe().GetEnabled(), got.GetEmbeddedIframe().GetEnabled(), "enable iframe embedding")
|
||||
assert.Equal(ct, want.GetEmbeddedIframe().GetAllowedOrigins(), got.GetEmbeddedIframe().GetAllowedOrigins(), "allowed origins")
|
||||
|
@@ -57,10 +57,12 @@ func TestServer_GetSecuritySettings(t *testing.T) {
|
||||
assert.EventuallyWithT(t, func(ct *assert.CollectT) {
|
||||
resp, err := Client.GetSecuritySettings(tt.ctx, &settings.GetSecuritySettingsRequest{})
|
||||
if tt.wantErr {
|
||||
require.Error(ct, err)
|
||||
assert.Error(ct, err)
|
||||
return
|
||||
}
|
||||
if !assert.NoError(ct, err) {
|
||||
return
|
||||
}
|
||||
require.NoError(ct, err)
|
||||
got, want := resp.GetSettings(), tt.want.GetSettings()
|
||||
assert.Equal(ct, want.GetEmbeddedIframe().GetEnabled(), got.GetEmbeddedIframe().GetEnabled(), "enable iframe embedding")
|
||||
assert.Equal(ct, want.GetEmbeddedIframe().GetAllowedOrigins(), got.GetEmbeddedIframe().GetAllowedOrigins(), "allowed origins")
|
||||
|
Reference in New Issue
Block a user