Skip to content

Commit d9e3111

Browse files
committed
Update connection queueing tests
1 parent 1b5cb65 commit d9e3111

File tree

3 files changed

+47
-182
lines changed

3 files changed

+47
-182
lines changed

test/list.txt

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,12 @@ Overview of node-oracledb functional tests
6262
2.6.3 stmtCacheSize must be a Number
6363
2.7 getConnection
6464
2.7.1 passes error in callback if called after pool is terminated and a callback is provided
65-
2.8 connection request queue (basic functionality)
66-
2.8.1 generates ORA-24418 when calling getConnection if queueing is disabled
67-
2.8.2 does not generate ORA-24418 when calling getConnection if queueing is enabled
68-
2.8.3 generates NJS-040 if request is queued and queueTimeout expires
69-
2.8.4 does not generate NJS-040 if request is queued for less time than queueTimeout
70-
2.9 connection request queue (_enableStats & _logStats functionality)
71-
2.9.1 does not works after the pool has been terminated
65+
2.8 connection queueing
66+
2.8.1 basic case
67+
2.8.2 generates NJS-040 if request is queued and queueTimeout expires
68+
2.8.3 does not generate NJS-040 if request is queued for less time than queueTimeout
69+
2.9 _enableStats & _logStats functionality
70+
2.9.1 does not work after the pool has been terminated
7271
2.10 Close method
7372
2.10.1 close can be used as an alternative to release
7473
2.11 Invalid Credential
@@ -911,22 +910,21 @@ Overview of node-oracledb functional tests
911910
58.1.12 outFormat
912911
58.1.13 lobPrefetchSize
913912
58.1.14 oracleClientVersion (read-only)
914-
58.1.15 queueRequests
915-
58.1.16 queueTimeout
916-
58.1.17 stmtCacheSize
917-
58.1.18 poolPingInterval
918-
58.1.19 fetchAsBuffer
919-
58.1.20 Negative - connectionClass
920-
58.1.21 Negative - autoCommit
921-
58.1.22 Negative - outFormat
922-
58.1.23 Negative - externalAuth
923-
58.1.24 versionString (read-only)
924-
58.1.25 versionSuffix (read-only)
925-
58.1.26 oracleClientVersionString (read-only)
926-
58.1.27 edition
927-
58.1.28 Negative - edition
928-
58.1.29 events
929-
58.1.30 Negative - events
913+
58.1.15 queueTimeout
914+
58.1.16 stmtCacheSize
915+
58.1.17 poolPingInterval
916+
58.1.18 fetchAsBuffer
917+
58.1.19 Negative - connectionClass
918+
58.1.20 Negative - autoCommit
919+
58.1.21 Negative - outFormat
920+
58.1.22 Negative - externalAuth
921+
58.1.23 versionString (read-only)
922+
58.1.24 versionSuffix (read-only)
923+
58.1.25 oracleClientVersionString (read-only)
924+
58.1.26 edition
925+
58.1.27 Negative - edition
926+
58.1.28 events
927+
58.1.29 Negative - events
930928
58.2 Pool Class
931929
58.2.1 poolMin
932930
58.2.2 poolMax
@@ -935,9 +933,8 @@ Overview of node-oracledb functional tests
935933
58.2.5 stmtCacheSize
936934
58.2.6 connectionsInUse
937935
58.2.7 connectionsOpen
938-
58.2.8 queueRequests
939-
58.2.9 queueTimeout
940-
58.2.10 poolPingInterval
936+
58.2.8 queueTimeout
937+
58.2.9 poolPingInterval
941938
58.3 Connection Class
942939
58.3.1 Connection object initial toString values
943940
58.3.2 stmtCacheSize (read-only)

test/pool.js

Lines changed: 7 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -239,61 +239,6 @@ describe('2. pool.js', function() {
239239
);
240240
});
241241

242-
it.skip('2.3.4 poolMax limits the pool capacity', function(done){
243-
oracledb.createPool(
244-
{
245-
user : dbConfig.user,
246-
password : dbConfig.password,
247-
connectString : dbConfig.connectString,
248-
poolMin : 1,
249-
poolMax : 2,
250-
poolIncrement : 1,
251-
poolTimeout : 28,
252-
stmtCacheSize : 23,
253-
queueRequests : false
254-
},
255-
function(err, pool) {
256-
should.not.exist(err);
257-
pool.should.be.ok();
258-
pool.connectionsInUse.should.be.exactly(0);
259-
260-
pool.getConnection( function(err, conn1){
261-
should.not.exist(err);
262-
conn1.should.be.ok();
263-
pool.connectionsOpen.should.be.exactly(1);
264-
pool.connectionsInUse.should.be.exactly(1);
265-
266-
pool.getConnection( function(err, conn2){
267-
should.not.exist(err);
268-
conn2.should.be.ok();
269-
pool.connectionsOpen.should.be.exactly(2);
270-
pool.connectionsInUse.should.be.exactly(2);
271-
272-
// Error occurs
273-
pool.getConnection( function(err, conn3){
274-
should.exist(err);
275-
(err.message).should.startWith('ORA-24418:');
276-
277-
should.not.exist(conn3);
278-
279-
conn2.release( function(err){
280-
should.not.exist(err);
281-
conn1.release( function(err){
282-
should.not.exist(err);
283-
pool.terminate( function(err){
284-
should.not.exist(err);
285-
done();
286-
});
287-
});
288-
});
289-
});
290-
});
291-
});
292-
293-
}
294-
);
295-
});
296-
297242
}); // 2.3
298243

299244
describe('2.4 poolIncrement', function(){
@@ -594,7 +539,7 @@ describe('2. pool.js', function() {
594539

595540
});
596541

597-
describe('2.8 connection request queue (basic functionality)', function(){
542+
describe('2.8 connection queueing', function(){
598543

599544
function getBlockingSql(secondsToBlock) {
600545
var blockingSql = '' +
@@ -613,64 +558,7 @@ describe('2. pool.js', function() {
613558
return blockingSql;
614559
}
615560

616-
it.skip('2.8.1 generates ORA-24418 when calling getConnection if queueing is disabled', function(done) {
617-
oracledb.createPool(
618-
{
619-
user : dbConfig.user,
620-
password : dbConfig.password,
621-
connectString : dbConfig.connectString,
622-
poolMin : 0,
623-
poolMax : 1,
624-
poolIncrement : 1,
625-
poolTimeout : 1,
626-
queueRequests : false
627-
},
628-
function(err, pool){
629-
should.not.exist(err);
630-
631-
async.parallel(
632-
[
633-
function(cb) {
634-
pool.getConnection(function(err, conn) {
635-
should.not.exist(err);
636-
637-
conn.execute(getBlockingSql(3), function(err) {
638-
should.not.exist(err);
639-
640-
conn.release(function(err) {
641-
should.not.exist(err);
642-
cb();
643-
});
644-
});
645-
});
646-
},
647-
function(cb) {
648-
//using setTimeout to help ensure this gets to the db last
649-
setTimeout(function() {
650-
pool.getConnection(function(err, conn) {
651-
should.exist(err);
652-
// ORA-24418: Cannot open further sessions
653-
(err.message).should.startWith('ORA-24418:');
654-
should.not.exist(conn);
655-
cb();
656-
});
657-
}, 200);
658-
}
659-
],
660-
function(err){
661-
should.not.exist(err);
662-
663-
pool.terminate(function(err) {
664-
should.not.exist(err);
665-
done();
666-
});
667-
}
668-
);
669-
}
670-
);
671-
});
672-
673-
it('2.8.2 does not generate ORA-24418 when calling getConnection', function(done) {
561+
it('2.8.1 basic case', function(done) {
674562
oracledb.createPool(
675563
{
676564
user : dbConfig.user,
@@ -701,7 +589,7 @@ describe('2. pool.js', function() {
701589
});
702590
},
703591
function(cb) {
704-
//using setTimeout to help ensure this gets to the db last
592+
//using setTimeout to help ensure this connection requests reaches DB later
705593
setTimeout(function() {
706594
pool.getConnection(function(err, conn) {
707595
should.not.exist(err);
@@ -727,7 +615,7 @@ describe('2. pool.js', function() {
727615
);
728616
});
729617

730-
it('2.8.3 generates NJS-040 if request is queued and queueTimeout expires', function(done) {
618+
it('2.8.2 generates NJS-040 if request is queued and queueTimeout expires', function(done) {
731619
oracledb.createPool(
732620
{
733621
user : dbConfig.user,
@@ -783,7 +671,7 @@ describe('2. pool.js', function() {
783671
);
784672
});
785673

786-
it('2.8.4 does not generate NJS-040 if request is queued for less time than queueTimeout', function(done) {
674+
it('2.8.3 does not generate NJS-040 if request is queued for less time than queueTimeout', function(done) {
787675
oracledb.createPool(
788676
{
789677
user : dbConfig.user,
@@ -841,8 +729,8 @@ describe('2. pool.js', function() {
841729
});
842730
});
843731

844-
describe('2.9 connection request queue (_enableStats & _logStats functionality)', function(){
845-
it('2.9.1 does not works after the pool has been terminated', function(done) {
732+
describe('2.9 _enableStats & _logStats functionality', function(){
733+
it('2.9.1 does not work after the pool has been terminated', function(done) {
846734
oracledb.createPool(
847735
{
848736
user : dbConfig.user,

0 commit comments

Comments
 (0)