@@ -5,6 +5,7 @@ import { chromium } from '@playwright/test';
55import type { BrowserContext } from '@playwright/test' ;
66
77import type { EnvironmentConfig } from '../../models/environment' ;
8+ import { withRetry } from '../../testUtils/retryableClerkClient' ;
89import { createUserService } from '../../testUtils/usersService' ;
910import type { FakeUser } from '../../testUtils/usersService' ;
1011
@@ -79,11 +80,13 @@ export async function getExtensionId(context: BrowserContext) {
7980 * Create a fake user from an env config and register it via the Backend API.
8081 */
8182export async function createTestUser ( env : EnvironmentConfig ) : Promise < FakeUser > {
82- const clerkClient = backendCreateClerkClient ( {
83- apiUrl : env . privateVariables . get ( 'CLERK_API_URL' ) ,
84- secretKey : env . privateVariables . get ( 'CLERK_SECRET_KEY' ) ,
85- publishableKey : env . publicVariables . get ( 'CLERK_PUBLISHABLE_KEY' ) ,
86- } ) ;
83+ const clerkClient = withRetry (
84+ backendCreateClerkClient ( {
85+ apiUrl : env . privateVariables . get ( 'CLERK_API_URL' ) ,
86+ secretKey : env . privateVariables . get ( 'CLERK_SECRET_KEY' ) ,
87+ publishableKey : env . publicVariables . get ( 'CLERK_PUBLISHABLE_KEY' ) ,
88+ } ) ,
89+ ) ;
8790 const users = createUserService ( clerkClient ) ;
8891 const fakeUser = users . createFakeUser ( ) ;
8992 await users . createBapiUser ( fakeUser ) ;
0 commit comments