Skip to content

Commit 4d2ad03

Browse files
authored
Fix memory leak (#133)
1 parent 4484c10 commit 4d2ad03

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

docs/source/memory-leak/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using:
4040
npx fuite http://localhost:9999/lab?reset -s memory-leaks/tests/notebook.mjs
4141
```
4242

43-
You can run in headless mode with the `-d` flag. And you can change the number
43+
You can run in headed mode with the `-d` flag. And you can change the number
4444
of iteration with `-i <number>` option.
4545

4646
> Don't forget the `?reset` query arguments to ensure the workspace is reset between each iteration.

memory-leaks/tests/cell.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ export async function iteration(page, data) {
4545

4646
switch (data.type) {
4747
case "raw":
48+
await page.keyboard.press("Escape");
4849
await page.keyboard.press("R");
4950
await page.waitForSelector(".jp-RawCell");
5051
break;
5152
case "markdown":
53+
await page.keyboard.press("Escape");
5254
await page.keyboard.press("M");
5355
await page.waitForSelector(".jp-MarkdownCell");
5456
break;
5557
case "code":
58+
await page.keyboard.press("Escape");
5659
await page.keyboard.press("C");
5760
await page.waitForXPath(
5861
'//div[contains(@class, "jp-CodeCell")][position() = last()]'

memory-leaks/tests/cell.test.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ describe("# Cell memory leaks", () => {
77
await testScenario(addScenario, {
88
expectations: [
99
// Code cell
10-
{ objects: 1400, collections: 32 },
10+
{ objects: 980, collections: 18 },
1111
// Markdown cell
12-
{ objects: 1365, collections: 55 },
12+
{ objects: 656, collections: 28 },
1313
// Raw cell
14-
{ objects: 1046, collections: 55 },
14+
{ objects: 548, collections: 28 },
1515
],
1616
});
1717
});

memory-leaks/tests/file-editor.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import * as scenario from "./file-editor.mjs";
33

44
describe("# File editor memory leaks", () => {
55
it("Opening a text file", async () => {
6-
await testScenario(scenario, { expectations: [{ objects: 681, collections: 4 }] });
6+
await testScenario(scenario, { expectations: [{ objects: 648, collections: 4 }] });
77
});
88
});

memory-leaks/tests/notebook.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as notebookScenario from "./notebook.mjs";
44
describe("# Notebook memory leaks", () => {
55
it("Opening a notebook", async () => {
66
await testScenario(notebookScenario, {
7-
expectations: [{ collections: 28, objects: 594 }],
7+
expectations: [{ collections: 8, objects: 463 }],
88
});
99
});
1010
});

0 commit comments

Comments
 (0)