test resolver: adopt connection-token, polish

This commit is contained in:
Martin Aeschlimann 2022-01-10 16:20:04 +01:00
parent e9203eedf9
commit a0fd6c88eb
No known key found for this signature in database
GPG key ID: 2609A01E695523E3

View file

@ -94,7 +94,7 @@ export function activate(context: vscode.ExtensionContext) {
env['VSCODE_AGENT_FOLDER'] = remoteDataDir;
outputChannel.appendLine(`Using data folder at ${remoteDataDir}`);
const connectionTokenFile = path.join(remoteDataDir, `${new Date().getTime()}.token`);
const connectionTokenFile = path.join(remoteDataDir, `${process.pid}-${new Date().getTime()}.token`);
fs.writeFileSync(connectionTokenFile, connectionToken);
commandArgs.push('--connection-token-file', connectionTokenFile);
@ -140,6 +140,11 @@ export function activate(context: vscode.ExtensionContext) {
if (extHostProcess) {
terminateProcess(extHostProcess, context.extensionPath);
}
try {
fs.unlinkSync(connectionTokenFile);
} catch (_e) {
//ignore
}
}
});
});