Parcourir la source

Merge pull request #7271 from telamonian/robustify-test-x

refactoring various tests to be faster/less likely to time out
Steven Silvester il y a 5 ans
Parent
commit
abbcb407cb
1 fichiers modifiés avec 16 ajouts et 5 suppressions
  1. 16 5
      tests/test-console/src/foreign.spec.ts

+ 16 - 5
tests/test-console/src/foreign.spec.ts

@@ -103,11 +103,20 @@ describe('@jupyterlab/console', () => {
     let handler: TestHandler;
     let session: IClientSession;
 
-    before(async () => {
+    before(async function() {
+      // tslint:disable-next-line:no-invalid-this
+      this.timeout(60000);
+
       const path = UUID.uuid4();
-      const sessions = [Session.startNew({ path }), Session.startNew({ path })];
-      [local, foreign] = await Promise.all(sessions);
-      session = await createClientSession({ path: local.path });
+      [local, foreign, session] = await Promise.all([
+        Session.startNew({ path }),
+        Session.startNew({ path }),
+        createClientSession({ path })
+      ]);
+
+      // check path prop
+      expect(local.path).to.equal(path);
+
       await (session as ClientSession).initialize();
       await session.kernel.ready;
     });
@@ -122,9 +131,11 @@ describe('@jupyterlab/console', () => {
     });
 
     after(async () => {
+      // local, foreign, and session share state, so only one shutdown
+      await session.shutdown();
+
       local.dispose();
       foreign.dispose();
-      await session.shutdown();
       session.dispose();
     });