Skip to content

Commit 419ecb1

Browse files
committed
Revert "Fix intermittent test failures"
This reverts commit baca18b.
1 parent baca18b commit 419ecb1

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

news/3 Code Health/4936.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

news/3 Code Health/4951.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/client/datascience/jupyter/jupyterServer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,7 @@ export class JupyterServerBase implements INotebookServer {
574574
if (this.launchInfo && this.launchInfo.connectionInfo) {
575575
// If the server crashes, cancel the current observable
576576
exitHandlerDisposable = this.launchInfo.connectionInfo.disconnected((c) => {
577-
const str = c ? c.toString() : '';
578-
subscriber.error(this.sessionStartTime, new Error(localize.DataScience.jupyterServerCrashed().format(str)));
577+
subscriber.error(this.sessionStartTime, new Error(localize.DataScience.jupyterServerCrashed().format(c.toString())));
579578
subscriber.complete(this.sessionStartTime);
580579
});
581580
}

src/client/datascience/jupyter/jupyterSession.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { callWithTimeout, sleep } from '../../common/utils/async';
2020
import * as localize from '../../common/utils/localize';
2121
import { noop } from '../../common/utils/misc';
2222
import { IConnection, IJupyterKernelSpec, IJupyterSession } from '../types';
23-
import { isTestExecution } from '../../common/constants';
2423

2524
export class JupyterSession implements IJupyterSession {
2625
private connInfo: IConnection | undefined;
@@ -183,17 +182,17 @@ export class JupyterSession implements IJupyterSession {
183182
if (this.session) {
184183
try {
185184
// Shutdown may fail if the process has been killed
186-
await Promise.race([this.session.shutdown(), sleep(1000)]);
185+
await Promise.race([this.session.shutdown(), sleep(100)]);
187186
} catch {
188187
noop();
189188
}
190189
// Dispose may not return. Wrap in a promise instead. Kernel futures can die if
191190
// process is already dead.
192-
if (this.session && !isTestExecution()) {
191+
if (this.session) {
193192
await callWithTimeout(this.session.dispose.bind(this.session), 100);
194193
}
195194
}
196-
if (this.sessionManager && !isTestExecution()) {
195+
if (this.sessionManager) {
197196
await callWithTimeout(this.sessionManager.dispose.bind(this.sessionManager), 100);
198197
}
199198
} catch {

src/test/datascience/mockLiveShare.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ class Emitter<T> {
126126
if (typeof item.listener === 'function') {
127127
result = item.listener.call(undefined, item.event);
128128
} else {
129-
const func = item.listener[0];
130-
if (func) {
131-
result = item.listener[0].call(item.listener[1], item.event);
132-
}
129+
result = item.listener[0].call(item.listener[1], item.event);
133130
}
134131
}
135132
} catch (e) {

0 commit comments

Comments
 (0)