Skip to content

Commit

Permalink
test: remove common.PORT from http tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Jun 29, 2016
1 parent dac16d8 commit 515db4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ const http = require('http');

const server = http.createServer((req, res) => {
res.end();
}).listen(common.PORT, common.mustCall(() => {
}).listen(0, common.mustCall(() => {
const agent = new http.Agent({
maxSockets: 1,
keepAlive: true
});

const port = server.address().port;

const post = http.request({
agent: agent,
method: 'POST',
port: common.PORT,
port: port,
}, common.mustCall((res) => {
res.resume();
}));
Expand All @@ -30,7 +32,7 @@ const server = http.createServer((req, res) => {
http.request({
agent: agent,
method: 'GET',
port: common.PORT,
port: port,
}, common.mustCall((res) => {
server.close();
res.connection.end();
Expand Down
8 changes: 5 additions & 3 deletions test/parallel/test-http-no-read-no-dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ const server = http.createServer((req, res) => {
res.end();
onPause();
});
}).listen(common.PORT, common.mustCall(() => {
}).listen(0, common.mustCall(() => {
const agent = new http.Agent({
maxSockets: 1,
keepAlive: true
});

const port = server.address().port;

const post = http.request({
agent: agent,
method: 'POST',
port: common.PORT,
port: port,
}, common.mustCall((res) => {
res.resume();

Expand All @@ -43,7 +45,7 @@ const server = http.createServer((req, res) => {
http.request({
agent: agent,
method: 'GET',
port: common.PORT,
port: port,
}, common.mustCall((res) => {
server.close();
res.connection.end();
Expand Down

0 comments on commit 515db4c

Please sign in to comment.