Skip to content

Commit

Permalink
fixing flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed Oct 6, 2023
1 parent 162b010 commit d818058
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/integration/testEasyLoggingOnConnecting.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('Easy logging tests', function () {
});

after(async function () {
await fsPromises.rm(tempDir, { recursive: true, force: true });
Logger.getInstance().configure({
level: logLevelBefore,
filePath: 'snowflake.log'
});
await fsPromises.rm(tempDir, { recursive: true, force: true });
});

afterEach(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/logger/easy_logging_starter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ before(async function () {
});

after(async function () {
await fsPromises.rm(tempDir, { recursive: true, force: true });
Logger.getInstance().configure({
level: logLevelBefore,
filePath: 'snowflake.log'
});
await fsPromises.rm(tempDir, { recursive: true, force: true });
});

afterEach(async function() {
Expand Down
6 changes: 5 additions & 1 deletion test/unit/snowflake_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ describe('connection.connect() success', function ()

describe('connection.connect() asynchronous errors', function ()
{
it('connect() while already connecting', function (done)
// This test is flaky. Sometimes the first connect is being executed too slow, so adding timeout = 0 on the second
// connect was a try to speed it up a bit.
// But sometimes the first connect is being executed too fast,
// and we get an error on the second attempt "already connected" instead of "connection already in progress".
xit('connect() while already connecting', function (done)
{
// create a connection and connect
var connection = snowflake.createConnection(connectionOptions).connect();
Expand Down

0 comments on commit d818058

Please sign in to comment.