From b1198b92c6919830b04811b4048c14d343481580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Fri, 4 Apr 2025 11:20:48 +0200 Subject: [PATCH] authinfoimpl: Fix TestIntegrationAuthInfoStore when running on Spanner. (#103383) Fix TestIntegrationAuthInfoStore when running on Spanner. --- pkg/services/login/authinfoimpl/store_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]) })