This commit is contained in:
2025-05-23 21:20:39 +00:00
parent 9629329bc2
commit 0907949f8a
86 changed files with 654 additions and 569 deletions

View File

@ -1,7 +1,7 @@
import * as plugins from '@git.zone/tstest/tapbundle';
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as net from 'net';
import { startTestServer, stopTestServer } from '../server.loader.js';
import { startTestServer, stopTestServer } from '../../helpers/server.loader.js';
const TEST_PORT = 2525;
@ -120,7 +120,7 @@ tap.test('ERR-05: Resource exhaustion handling - Connection limit', async (tools
console.log(`Exhaustion detected: ${exhaustionDetected}`);
if (lastError) console.log(`Last error: ${lastError}`);
expect(hasResourceProtection).toBeTrue();
expect(hasResourceProtection).toEqual(true);
done.resolve();
} catch (error) {
console.error('Test error:', error);
@ -236,12 +236,12 @@ tap.test('ERR-05: Resource exhaustion handling - Memory limits', async (tools) =
}
// Resource protection is working if we got an error or protective response
expect(resourceError || endResponse.includes('552') || endResponse.includes('451')).toBeTrue();
expect(resourceError || endResponse.includes('552') || endResponse.includes('451')).toEqual(true);
} catch (err) {
// Errors during large data transmission indicate resource protection
console.log('Expected resource protection error:', err);
expect(true).toBeTrue();
expect(true).toEqual(true);
}
socket.write('QUIT\r\n');