Skip to content

Commit 04e9a9c

Browse files
authored
Up idle timeout to match launch timeout (nightly flake failure) (microsoft#13753)
* Up idle timeout to match launch timeout. Test was really close to 30 secs so it failed * Up launch time out
1 parent 2b007d1 commit 04e9a9c

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/client/datascience/jupyter/jupyterSession.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export class JupyterSession extends BaseJupyterSession {
3737
private readonly outputChannel: IOutputChannel,
3838
private readonly restartSessionCreated: (id: Kernel.IKernelConnection) => void,
3939
restartSessionUsed: (id: Kernel.IKernelConnection) => void,
40-
readonly workingDirectory: string
40+
readonly workingDirectory: string,
41+
private readonly idleTimeout: number
4142
) {
4243
super(restartSessionUsed, workingDirectory);
4344
this.kernelConnectionMetadata = kernelSpec;
@@ -106,15 +107,14 @@ export class JupyterSession extends BaseJupyterSession {
106107
if (!session || !this.contentsManager || !this.sessionManager) {
107108
throw new Error(localize.DataScience.sessionDisposed());
108109
}
109-
110110
let result: ISessionWithSocket | undefined;
111111
let tryCount = 0;
112112
// tslint:disable-next-line: no-any
113113
let exception: any;
114114
while (tryCount < 3) {
115115
try {
116116
result = await this.createSession(session.serverSettings, kernelConnection, cancelToken);
117-
await this.waitForIdleOnSession(result, 30000);
117+
await this.waitForIdleOnSession(result, this.idleTimeout);
118118
this.restartSessionCreated(result.kernel);
119119
return result;
120120
} catch (exc) {

src/client/datascience/jupyter/jupyterSessionManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ export class JupyterSessionManager implements IJupyterSessionManager {
182182
this.outputChannel,
183183
this.restartSessionCreatedEvent.fire.bind(this.restartSessionCreatedEvent),
184184
this.restartSessionUsedEvent.fire.bind(this.restartSessionUsedEvent),
185-
workingDirectory
185+
workingDirectory,
186+
this.configService.getSettings().datascience.jupyterLaunchTimeout
186187
);
187188
try {
188189
await session.connect(this.configService.getSettings().datascience.jupyterLaunchTimeout, cancelToken);

src/test/datascience/dataScienceIocContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer {
14191419
pythonSettings.datascience = {
14201420
allowImportFromNotebook: true,
14211421
alwaysTrustNotebooks: true,
1422-
jupyterLaunchTimeout: 60000,
1422+
jupyterLaunchTimeout: 120000,
14231423
jupyterLaunchRetries: 3,
14241424
enabled: true,
14251425
jupyterServerURI: 'local',

src/test/datascience/jupyter/jupyterSession.unit.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ suite('DataScience - JupyterSession', () => {
9595
() => {
9696
restartSessionUsedEvent.resolve();
9797
},
98-
''
98+
'',
99+
60_000
99100
);
100101
});
101102

0 commit comments

Comments
 (0)