diff --git a/tests/complex/test-binary-buffers.js b/tests/complex/test-binary-buffers.js index 5860a79..898b8cb 100644 --- a/tests/complex/test-binary-buffers.js +++ b/tests/complex/test-binary-buffers.js @@ -37,8 +37,11 @@ exports.createTestTableComplex2BinaryBlobs = function (test) { " (vc, vbi, bi, b) VALUES ('34\\0\\0', '34\\0\\0', '34\\0\\0', '34\\0\\0');") && res; test.ok(res, "conn.querySync('INSERT INTO test_table2 ...')"); - conn.closeSync(); - test.done(); + // Ensure all rows are inserted + setTimeout(function () { + conn.closeSync(); + test.done(); + }, 100); }; exports.FetchAllSyncWithBinaryFields = function (test) { diff --git a/tests/simple/test-class-mysqlconnection.js b/tests/simple/test-class-mysqlconnection.js index d6ab3fd..a832a23 100644 --- a/tests/simple/test-class-mysqlconnection.js +++ b/tests/simple/test-class-mysqlconnection.js @@ -507,12 +507,15 @@ exports.LastInsertIdSync = function (test) { } test.equals(res, true, "Insert " + cfg.insert_rows_count + " rows into table " + cfg.test_table); - last_insert_id = conn.lastInsertIdSync(); - test.equals(last_insert_id, cfg.insert_rows_count, "conn.lastInsertIdSync()"); - conn.closeSync(); - - test.done(); + // Ensure all rows are inserted + setTimeout(function () { + last_insert_id = conn.lastInsertIdSync(); + test.equals(last_insert_id, cfg.insert_rows_count, "conn.lastInsertIdSync()"); + + conn.closeSync(); + test.done(); + }, 100); }; exports.MultiMoreResultsSync = function (test) {