This commit is contained in:
Boki 2025-06-22 17:55:51 -04:00
parent d858222af7
commit 7d9044ab29
202 changed files with 10755 additions and 10972 deletions

View file

@ -1,12 +1,14 @@
import { describe, test, expect, beforeEach, afterEach } from 'bun:test';
import { QueueManager, handlerRegistry } from '../src';
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
import { handlerRegistry, QueueManager } from '../src';
// Suppress Redis connection errors in tests
process.on('unhandledRejection', (reason, promise) => {
if (reason && typeof reason === 'object' && 'message' in reason) {
const message = (reason as Error).message;
if (message.includes('Connection is closed') ||
message.includes('Connection is in monitoring mode')) {
if (
message.includes('Connection is closed') ||
message.includes('Connection is in monitoring mode')
) {
// Suppress these specific Redis errors in tests
return;
}
@ -34,9 +36,7 @@ describe('QueueManager Integration Tests', () => {
try {
await Promise.race([
queueManager.shutdown(),
new Promise((_, reject) =>
setTimeout(() => reject(new Error('Shutdown timeout')), 3000)
)
new Promise((_, reject) => setTimeout(() => reject(new Error('Shutdown timeout')), 3000)),
]);
} catch (error) {
// Ignore shutdown errors in tests
@ -45,10 +45,10 @@ describe('QueueManager Integration Tests', () => {
queueManager = null as any;
}
}
// Clear handler registry to prevent conflicts
handlerRegistry.clear();
// Add delay to allow connections to close
await new Promise(resolve => setTimeout(resolve, 100));
});