Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed May 1, 2024
1 parent 50df506 commit 9bcfed8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('index.test.ts', () => {
assert.equal(response.url, `${_url}html`);
assert(!response.redirected);
assert.equal(getDefaultHttpClient(), getDefaultHttpClient());
console.log('stats %o', getDefaultHttpClient().getDispatcherPoolStats());
// console.log('stats %o', getDefaultHttpClient().getDispatcherPoolStats());
});
});

Expand Down Expand Up @@ -76,7 +76,7 @@ describe('index.test.ts', () => {
dataType: 'json',
});
assert.equal(response.status, 200);
console.log(response.data.hello);
// console.log(response.data.hello);
});

it('should curl alias to request', async () => {
Expand Down
8 changes: 4 additions & 4 deletions test/keep-alive-header.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('keep-alive-header.test.ts', () => {
count++;
try {
const task = httpClient.request(_url);
console.log('after request stats: %o', httpClient.getDispatcherPoolStats());
// console.log('after request stats: %o', httpClient.getDispatcherPoolStats());
if (httpClient.getDispatcherPoolStats()[origin]) {
if (!(nodeMajorVersion() === 14 || isWindows())) {
// ignore node = 14 & windows
Expand All @@ -40,7 +40,7 @@ describe('keep-alive-header.test.ts', () => {
}
}
let response = await task;
console.log('after response stats: %o', httpClient.getDispatcherPoolStats());
// console.log('after response stats: %o', httpClient.getDispatcherPoolStats());
assert.equal(httpClient.getDispatcherPoolStats()[origin].pending, 0);
assert.equal(httpClient.getDispatcherPoolStats()[origin].connected, 1);
// console.log(response.res.socket);
Expand Down Expand Up @@ -129,12 +129,12 @@ describe('keep-alive-header.test.ts', () => {
assert.equal(response.headers.connection, 'keep-alive');
assert.equal(response.headers['keep-alive'], 'timeout=2');
assert(parseInt(response.headers['x-requests-persocket'] as string) > 1);
console.log('before sleep stats: %o', httpClient.getDispatcherPoolStats());
// console.log('before sleep stats: %o', httpClient.getDispatcherPoolStats());
// { connected: 2, free: 1, pending: 0, queued: 0, running: 0, size: 0 }
assert.equal(httpClient.getDispatcherPoolStats()[origin].connected, 2);
assert.equal(httpClient.getDispatcherPoolStats()[origin].free, 1);
await sleep(keepAliveTimeout);
console.log('after sleep stats: %o', httpClient.getDispatcherPoolStats());
// console.log('after sleep stats: %o', httpClient.getDispatcherPoolStats());
// clients maybe all gone => after sleep stats: {}
// { connected: 0, free: 0, pending: 0, queued: 0, running: 0, size: 0 }
// { connected: 1, free: 1, pending: 0, queued: 0, running: 0, size: 0 }
Expand Down

0 comments on commit 9bcfed8

Please sign in to comment.