Adding a stability test: non referenced, unused requests are collected without crash.
This commit is contained in:
parent
0e13b8dd01
commit
c6ae27c7c9
1 changed files with 31 additions and 1 deletions
|
@ -25,7 +25,7 @@ const kOneKiloByte = 1024
|
||||||
const kOneMegaByte = kOneKiloByte * kOneKiloByte
|
const kOneMegaByte = kOneKiloByte * kOneKiloByte
|
||||||
|
|
||||||
describe('net module', function () {
|
describe('net module', function () {
|
||||||
// this.timeout(0)
|
this.timeout(0)
|
||||||
describe('HTTP basics', function () {
|
describe('HTTP basics', function () {
|
||||||
let server
|
let server
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@ -1154,4 +1154,34 @@ describe('net module', function () {
|
||||||
urlRequest.end()
|
urlRequest.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
describe('Stability and performance', function(done) {
|
||||||
|
let server
|
||||||
|
beforeEach(function (done) {
|
||||||
|
server = http.createServer()
|
||||||
|
server.listen(0, '127.0.0.1', function () {
|
||||||
|
server.url = 'http://127.0.0.1:' + server.address().port
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
server.close()
|
||||||
|
server = null
|
||||||
|
})
|
||||||
|
|
||||||
|
it.only('should free unreferenced, never-started request objects', function() {
|
||||||
|
const requestUrl = '/requestUrl'
|
||||||
|
const urlRequest = net.request( `${server.url}${requestUrl}`)
|
||||||
|
process.nextTick(function() {
|
||||||
|
net._RequestGarbageCollectionForTesting()
|
||||||
|
process.nextTick(done)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
it.skip('should not collect on-going requests', function(done) {
|
||||||
|
assert(false)
|
||||||
|
})
|
||||||
|
it.skip('should collect unreferenced, ended requests', function(done) {
|
||||||
|
assert(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue