Skip to content

Commit cf51c02

Browse files
committed
Revert "test: cleanup early 413 upload timer"
This reverts commit 904b9db.
1 parent 80c1fd9 commit cf51c02

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

test/server-socket.test.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,6 @@ describe('autoCleanupIncoming: true (default)', () => {
245245
let responseBody = ''
246246
let responseStatus = 0
247247
let requestError: Error | null = null
248-
let sendTimer: ReturnType<typeof setTimeout> | undefined
249-
250-
const cleanupSendTimer = () => {
251-
if (sendTimer) {
252-
clearTimeout(sendTimer)
253-
sendTimer = undefined
254-
}
255-
}
256248

257249
const req = request(
258250
{
@@ -279,7 +271,6 @@ describe('autoCleanupIncoming: true (default)', () => {
279271

280272
req.on('close', reqClose)
281273
req.on('error', (err) => {
282-
cleanupSendTimer()
283274
requestError = err
284275
})
285276

@@ -293,12 +284,11 @@ describe('autoCleanupIncoming: true (default)', () => {
293284
}
294285
req.write(Buffer.alloc(Math.min(chunkSize, totalSize - offset)))
295286
offset += chunkSize
296-
sendTimer = setTimeout(sendChunk, 5)
287+
setTimeout(sendChunk, 5)
297288
}
298289
sendChunk()
299290

300291
await Promise.all([reqPromise, resPromise])
301-
cleanupSendTimer()
302292
expect(responseStatus).toBe(413)
303293
if (!expectEmptyBody) {
304294
expect(responseBody).toBe('Payload Too Large')

0 commit comments

Comments
 (0)