We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac78e29 commit f336d5fCopy full SHA for f336d5f
test/integration/test-pool-end.js
@@ -0,0 +1,22 @@
1
+'use strict';
2
+
3
+const { createPool } = require('../common.js');
4
+const assert = require('assert');
5
6
+const pool = createPool();
7
8
+pool.getConnection((err, conn) => {
9
+ assert.ifError(err);
10
11
+ assert(pool._allConnections.length === 1);
12
+ assert(pool._freeConnections.length === 0);
13
14
+ // emit the end event, so the connection gets removed from the pool
15
+ conn.stream.emit('end');
16
17
+ assert(pool._allConnections.length === 0);
18
19
20
+ // As the connection has not really ended we need to this ourselves
21
+ conn.destroy();
22
+});
0 commit comments