Skip to content

Commit

Permalink
avoid adding test session to session tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
Hweinstock committed Nov 15, 2024
1 parent 78454d9 commit 2f092e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/awsService/ec2/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ export class Ec2Connecter implements vscode.Disposable {

const remoteUser = await this.getRemoteUser(selection.instanceId)
const remoteEnv = await this.prepareEc2RemoteEnvWithProgress(selection, remoteUser)

const testSession = await this.ssmClient.startSession(selection.instanceId, 'AWS-StartSSHSession')
try {
const testSession = await this.startSSMSession(selection.instanceId)
await testSshConnection(
remoteEnv.SessionProcess,
remoteEnv.hostname,
Expand All @@ -211,6 +210,8 @@ export class Ec2Connecter implements vscode.Disposable {
await startVscodeRemote(remoteEnv.SessionProcess, remoteEnv.hostname, '/', remoteEnv.vscPath, remoteUser)
} catch (err) {
this.throwGeneralConnectionError(selection, err as Error)
} finally {
await this.ssmClient.terminateSession(testSession)
}
}

Expand Down

0 comments on commit 2f092e1

Please sign in to comment.