diff --git a/lib/connection/connection_config.js b/lib/connection/connection_config.js index 3b77cab54..1a3954b39 100644 --- a/lib/connection/connection_config.js +++ b/lib/connection/connection_config.js @@ -471,7 +471,6 @@ function ConnectionConfig(options, validateCredentials, qaMode, clientInfo) let disableQueryContextCache = false; if (Util.exists(options.disableQueryContextCache)) { - Errors.checkArgumentValid(Util.isBoolean(options.disableQueryContextCache), ErrorCodes.ERR_CONN_CREATE_INVALID_DISABLED_QUERY_CONTEXT_CACHE); diff --git a/lib/queryContextCache.js b/lib/queryContextCache.js index 609bf6266..c68df3234 100644 --- a/lib/queryContextCache.js +++ b/lib/queryContextCache.js @@ -1,6 +1,7 @@ /* - * Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved. + * Copyright (c) 2023 Snowflake Computing Inc. All rights reserved. */ + const Logger = require('./logger'); /** diff --git a/test/integration/testHTAP.js b/test/integration/testHTAP.js index aebb3fe7a..9a1f593c2 100644 --- a/test/integration/testHTAP.js +++ b/test/integration/testHTAP.js @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2023 Snowflake Computing Inc. All rights reserved. + */ + const assert = require('assert'); const async = require('async'); const connOption = require('./connectionOptions').valid; @@ -6,16 +10,11 @@ const testUtil = require('./testUtil'); // Only the AWS servers support the hybrid table in the GitHub action. if (process.env.CLOUD_PROVIDER === 'AWS') { describe('Query Context Cache test', function () { - this.timeout(1000000); let connection; - before((done) => { + before(async () => { connection = testUtil.createConnection(connOption); - async.series([ - function (callback) { - testUtil.connect(connection, callback); - }], - done); + await testUtil.connectAsync(connection); }); after(async () => { @@ -93,9 +92,7 @@ if (process.env.CLOUD_PROVIDER === 'AWS') { } it('test Query Context Cache', function (done) { - async.series(createQueryTest(), function () { - done(); - }); + async.series(createQueryTest(), done); }); }); } \ No newline at end of file diff --git a/test/unit/query_context_cache_test.js b/test/unit/query_context_cache_test.js index 5d9cea884..139af8f95 100644 --- a/test/unit/query_context_cache_test.js +++ b/test/unit/query_context_cache_test.js @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2023 Snowflake Computing Inc. All rights reserved. + */ + const QueryContextCache = require('../../lib/queryContextCache.js'); const assert = require('assert'); @@ -80,7 +84,6 @@ function TestingQCC () { describe('Query Context Cache Test', function () { const testingQcc = new TestingQCC(); - /** Test for empty cache */ it('test - the cache is empty',function () { testingQcc.initCache(); assert.strictEqual(testingQcc.qcc.getSize(), 0); @@ -105,7 +108,7 @@ describe('Query Context Cache Test', function () { // Add one more element at the end const i = MAX_CAPACITY; - const extraQCE = new QueryContextElement(BASE_ID + i, BASE_READ_TIMESTAMP + i, BASE_PRIORITY + i, CONTEXT) + const extraQCE = new QueryContextElement(BASE_ID + i, BASE_READ_TIMESTAMP + i, BASE_PRIORITY + i, CONTEXT); testingQcc.qcc.merge(extraQCE); testingQcc.qcc.checkCacheCapacity(); @@ -134,7 +137,7 @@ describe('Query Context Cache Test', function () { const updatedID = 3; const updatedPriority = BASE_PRIORITY + updatedID + 7; testingQcc.expectedPriority[updatedID] = updatedPriority; - const updatedQCE = new QueryContextElement(BASE_ID + updatedID, BASE_READ_TIMESTAMP + updatedID, testingQcc.expectedPriority[updatedID], CONTEXT) + const updatedQCE = new QueryContextElement(BASE_ID + updatedID, BASE_READ_TIMESTAMP + updatedID, testingQcc.expectedPriority[updatedID], CONTEXT); testingQcc.qcc.merge(updatedQCE); testingQcc.qcc.checkCacheCapacity(); @@ -170,7 +173,7 @@ describe('Query Context Cache Test', function () { // Add one more element with same priority const i = 2; - const samePriorityQCE = new QueryContextElement(BASE_ID + i, BASE_READ_TIMESTAMP + i - 10, BASE_PRIORITY + i, CONTEXT) + const samePriorityQCE = new QueryContextElement(BASE_ID + i, BASE_READ_TIMESTAMP + i - 10, BASE_PRIORITY + i, CONTEXT); testingQcc.qcc.merge(samePriorityQCE); testingQcc.qcc.checkCacheCapacity();