diff --git a/pkg/services/login/authinfoimpl/store_test.go b/pkg/services/login/authinfoimpl/store_test.go index 9fad32337e8..6dcfbf7910d 100644 --- a/pkg/services/login/authinfoimpl/store_test.go +++ b/pkg/services/login/authinfoimpl/store_test.go @@ -50,7 +50,10 @@ func TestIntegrationAuthInfoStore(t *testing.T) { require.NoError(t, err) require.Len(t, labels, 2) - require.Equal(t, login.AzureADAuthModule, labels[1]) + // There is no guarantee that user with user_id=1 gets "oauth_azuread" or "ldap". + // Both are valid results for the query (basically SELECT * FROM `user_auth` WHERE `user_id` IN (1,2) ORDER BY created), + // Spanner emulator will randomize its output, so test cannot rely on the ordering (other than "Created" column, which is equal here). + require.True(t, labels[1] == login.AzureADAuthModule || labels[1] == login.LDAPAuthModule) require.Equal(t, login.GoogleAuthModule, labels[2]) })