Skip to content

Commit ff14d7d

Browse files
fix: wait for unprepare() to complete before closing connection
The test was calling close() immediately after unprepare(), which would cancel the unprepare operation. Now the test properly waits for the unprepare requestCompleted event before closing the connection. Co-authored-by: Arthur Schreiber <arthurschreiber@users.noreply.github.com>
1 parent b58f128 commit ff14d7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/integration/prepare-execute-statements-test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ describe('Prepare Execute Statement', function() {
195195
executionCount++;
196196
errors.push(request.error);
197197

198-
// Unprepare and close
198+
// Unprepare the statement and wait for it to complete before closing
199+
request.once('requestCompleted', function() {
200+
connection.close();
201+
});
199202
connection.unprepare(request);
200-
connection.close();
201203
});
202204

203205
connection.execute(request, { divisor: 2 });

0 commit comments

Comments
 (0)