Skip to content

Commit 2f092e1

Browse files
committed
avoid adding test session to session tracker
1 parent 78454d9 commit 2f092e1

File tree

1 file changed

+3
-2
lines changed
  • packages/core/src/awsService/ec2

1 file changed

+3
-2
lines changed

packages/core/src/awsService/ec2/model.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,8 @@ export class Ec2Connecter implements vscode.Disposable {
198198

199199
const remoteUser = await this.getRemoteUser(selection.instanceId)
200200
const remoteEnv = await this.prepareEc2RemoteEnvWithProgress(selection, remoteUser)
201-
201+
const testSession = await this.ssmClient.startSession(selection.instanceId, 'AWS-StartSSHSession')
202202
try {
203-
const testSession = await this.startSSMSession(selection.instanceId)
204203
await testSshConnection(
205204
remoteEnv.SessionProcess,
206205
remoteEnv.hostname,
@@ -211,6 +210,8 @@ export class Ec2Connecter implements vscode.Disposable {
211210
await startVscodeRemote(remoteEnv.SessionProcess, remoteEnv.hostname, '/', remoteEnv.vscPath, remoteUser)
212211
} catch (err) {
213212
this.throwGeneralConnectionError(selection, err as Error)
213+
} finally {
214+
await this.ssmClient.terminateSession(testSession)
214215
}
215216
}
216217

0 commit comments

Comments
 (0)