Skip to content

Commit 289aff7

Browse files
committed
[misc] improving test stability
1 parent 0e8e8ad commit 289aff7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/integration/test-redirection.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ describe('redirection', () => {
1818
resetAfterUse: false
1919
});
2020
await proxy.start();
21-
let conn = await base.createConnection({ host: 'localhost', port: proxy.port() });
21+
let conn = null;
2222
try {
23+
conn = await base.createConnection({ host: 'localhost', port: proxy.port() });
2324
assert.equal(proxy.port(), conn.info.port);
2425
let permitRedirection = true;
2526
try {
@@ -36,7 +37,7 @@ describe('redirection', () => {
3637
await conn2.end();
3738
}
3839
} finally {
39-
conn.end();
40+
if (conn) conn.end();
4041
proxy.close();
4142
}
4243
});

0 commit comments

Comments
 (0)