File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ function getPasswordHashParts(password: string) {
7575}
7676
7777async function checkIsCommonPassword ( password : string ) {
78+ // In mocks mode we don't want to make external HTTP requests for password
79+ // strength checks (it can hang CI / e2e test runs and adds nondeterminism).
80+ if ( process . env . MOCKS === 'true' ) return false
81+
7882 const [ prefix , suffix ] = getPasswordHashParts ( password )
7983 try {
8084 const response = await fetchWithTimeout (
Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ export async function gravatarExistsForEmail({
4242 staleWhileRevalidate : 1000 * 60 * 60 * 24 * 365 ,
4343 checkValue : ( prevValue ) => typeof prevValue === 'boolean' ,
4444 getFreshValue : async ( context ) => {
45+ // In mocks mode we should not make external HTTP requests (can hang/flake
46+ // CI/e2e runs, especially with Node v24 fetch abort issues).
47+ if ( process . env . MOCKS === 'true' ) {
48+ context . metadata . ttl = 1000 * 60 * 60 * 24 * 365
49+ return false
50+ }
51+
4552 const gravatarUrl = getAvatar ( email , { fallback : '404' } )
4653 try {
4754 const timeoutMs = context . background || forceFresh ? 1000 * 10 : 100
You can’t perform that action at this time.
0 commit comments