Skip to content

Commit da4e45f

Browse files
committed
pr feedback
1 parent 61a9885 commit da4e45f

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

packages/spanner/test/session-pool.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ describe('SessionEvictor', function() {
15631563
sessionEvictor.evict(CONFIG, RESOURCE, AVAILABLE);
15641564
});
15651565

1566-
it('should run a query & update evicted status on session', function(done) {
1566+
it('should set evicted to true when a session expires', function(done) {
15671567
sessionEvictor.evictor.evict = function() {
15681568
return true;
15691569
};
@@ -1580,6 +1580,23 @@ describe('SessionEvictor', function() {
15801580
sessionEvictor.evict(CONFIG, RESOURCE, AVAILABLE);
15811581
});
15821582

1583+
it('should set evicted to false when sessions dont expire', function(done) {
1584+
sessionEvictor.evictor.evict = function() {
1585+
return true;
1586+
};
1587+
1588+
RESOURCE.obj.keepAlive = function(callback) {
1589+
callback(null);
1590+
1591+
setImmediate(function() {
1592+
assert.strictEqual(RESOURCE.obj.evicted_, false);
1593+
done();
1594+
});
1595+
};
1596+
1597+
sessionEvictor.evict(CONFIG, RESOURCE, AVAILABLE);
1598+
});
1599+
15831600
it('should return false if still active', function() {
15841601
var evictReturnValue = sessionEvictor.evict(CONFIG, RESOURCE, AVAILABLE);
15851602
assert.strictEqual(evictReturnValue, false);

packages/spanner/test/session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ describe('Session', function() {
232232
});
233233

234234
describe('keepAlive', function() {
235-
it('should correctl call and return the gax API', function() {
235+
it('should correctly call and return the gax API', function() {
236236
var gaxReturnValue = {};
237237

238238
function callback() {}

0 commit comments

Comments
 (0)