fix(tests): use high non-privileged ports in tests to avoid conflicts and CI failures

This commit is contained in:
2026-02-21 13:27:55 +00:00
parent d4739045cd
commit 9368226ce0
9 changed files with 55 additions and 48 deletions
+6 -6
View File
@@ -4,7 +4,7 @@ import * as http from 'http';
tap.test('should forward HTTP connections on port 8080', async (tapTest) => {
// Create a mock HTTP server to act as our target
const targetPort = 8181;
const targetPort = 47732;
let receivedRequest = false;
let receivedPath = '';
@@ -36,7 +36,7 @@ tap.test('should forward HTTP connections on port 8080', async (tapTest) => {
routes: [{
name: 'test-route',
match: {
ports: 8080
ports: 47730
// Remove domain restriction for HTTP connections
// Domain matching happens after HTTP headers are received
},
@@ -55,7 +55,7 @@ tap.test('should forward HTTP connections on port 8080', async (tapTest) => {
// Make an HTTP request to port 8080
const options = {
hostname: 'localhost',
port: 8080,
port: 47730,
path: '/.well-known/acme-challenge/test-token',
method: 'GET',
headers: {
@@ -104,7 +104,7 @@ tap.test('should forward HTTP connections on port 8080', async (tapTest) => {
tap.test('should handle basic HTTP request forwarding', async (tapTest) => {
// Create a simple target server
const targetPort = 8182;
const targetPort = 47733;
let receivedRequest = false;
const targetServer = http.createServer((req, res) => {
@@ -126,7 +126,7 @@ tap.test('should handle basic HTTP request forwarding', async (tapTest) => {
routes: [{
name: 'simple-forward',
match: {
ports: 8081
ports: 47731
// Remove domain restriction for HTTP connections
},
action: {
@@ -142,7 +142,7 @@ tap.test('should handle basic HTTP request forwarding', async (tapTest) => {
// Make request
const options = {
hostname: 'localhost',
port: 8081,
port: 47731,
path: '/test',
method: 'GET',
headers: {