mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-09 21:16:48 +03:00
fix: resolve CI test failures and timeouts
- Update Bun version in CI to match local version (1.2.16) - Add bunfig.toml with 5s test timeout to prevent hanging tests - Mock setTimeout globally in test setup to avoid timing issues - Add NODE_ENV check to skip delays during tests - Fix missing exports in config-encryption mock - Remove retryDelay in tests to ensure immediate execution These changes ensure tests run consistently between local and CI environments
This commit is contained in:
@@ -157,9 +157,11 @@ export async function getOrCreateGiteaOrgEnhanced({
|
||||
console.log(`[Org Creation] Organization creation failed due to duplicate. Will retry check.`);
|
||||
|
||||
// Wait before retry with exponential backoff
|
||||
const delay = retryDelay * Math.pow(2, attempt);
|
||||
const delay = process.env.NODE_ENV === 'test' ? 0 : retryDelay * Math.pow(2, attempt);
|
||||
console.log(`[Org Creation] Waiting ${delay}ms before retry...`);
|
||||
await new Promise(resolve => setTimeout(resolve, delay));
|
||||
if (delay > 0) {
|
||||
await new Promise(resolve => setTimeout(resolve, delay));
|
||||
}
|
||||
continue; // Retry the loop
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user