| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ if (!common.hasCrypto) | |||
| 5 | 5 | common.skip('missing crypto'); | |
| 6 | 6 | const assert = require('assert'); | |
| 7 | 7 | const h2 = require('http2'); | |
| 8 | + const Countdown = require('../common/countdown'); | ||
| 8 | 9 | ||
| 9 | 10 | // Calling .destroy() on the socket proxy must not throw | |
| 10 | 11 | // (previously threw ERR_HTTP2_NO_SOCKET_MANIPULATION) and must | |
@@ -17,6 +18,8 @@ server.on('stream', common.mustCall(function(stream) { | |||
| 17 | 18 | stream.end('ok'); | |
| 18 | 19 | }, 2)); | |
| 19 | 20 | ||
| 21 | + const countdown = new Countdown(2, () => server.close()); | ||
| 22 | + | ||
| 20 | 23 | server.listen(0, common.mustCall(() => { | |
| 21 | 24 | const port = server.address().port; | |
| 22 | 25 | ||
@@ -33,6 +36,7 @@ server.listen(0, common.mustCall(() => { | |||
| 33 | 36 | assert.strictEqual(client.socket, undefined); | |
| 34 | 37 | // Destroying again through a stale proxy reference must not throw. | |
| 35 | 38 | socket.destroy(); | |
| 39 | + countdown.dec(); | ||
| 36 | 40 | })); | |
| 37 | 41 | })); | |
| 38 | 42 | client.on('error', common.mustNotCall()); | |
@@ -51,7 +55,7 @@ server.listen(0, common.mustCall(() => { | |||
| 51 | 55 | assert.strictEqual(err.message, 'boom'); | |
| 52 | 56 | })); | |
| 53 | 57 | client.on('close', common.mustCall(() => { | |
| 54 | - server.close(); | ||
| 58 | + countdown.dec(); | ||
| 55 | 59 | })); | |
| 56 | 60 | } | |
| 57 | 61 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments