Skip to content

Commit

Permalink
Merge pull request #172 from kirksl/1.2.3
Browse files Browse the repository at this point in the history
1.2.3
  • Loading branch information
kirksl authored Feb 20, 2023
2 parents 088f9be + 9775422 commit 5af1a2c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Notable changes to this project will be documented in this file.


## 1.2.3
https://github.com/kirksl/karate-runner/milestone/14

## 1.2.2
https://github.com/kirksl/karate-runner/milestone/13

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/kirksl/karate-runner"
},
"version": "1.2.2",
"version": "1.2.3",
"appInsightsId": "a285938d-a115-44ea-be2a-588a243d5f2c",
"license": "MIT",
"author": {
Expand Down
31 changes: 19 additions & 12 deletions src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,31 @@ interface ITestExecutionDetail

async function isPortFree(port: number): Promise<boolean>
{
return new Promise((resolve) =>
return new Promise((resolve, reject) =>
{
var server = net.createServer();
server.unref();
let s = net.createServer();

server.listen({host: 'localhost', port: port, exclusive: true }, () =>
s.once('error', (err) =>
{
server.close(() =>
s.close();
if (err["code"] == "EADDRINUSE")
{
resolve(true);
});
});
resolve(false);
}
else
{
resolve(false);
}
});

server.on('error', () =>
s.once('listening', () =>
{
resolve(false);
});
});
resolve(true);
s.close();
});

s.listen(port);
});
}

function getProjectDetail(uri: vscode.Uri, type: vscode.FileType): IProjectDetail
Expand Down

0 comments on commit 5af1a2c

Please sign in to comment.