Skip to content

Commit

Permalink
Attempt to make macOS CI more robust (#2310)
Browse files Browse the repository at this point in the history
Just tuned / cleaned up the sleeps for our custom spoken forms tests.
Mac tests passed 3 times in a row, which seems unlikely by chance given
current unreliability, so I'd be tempted to ship it. Tempted to mock
filesystem to make it faster / more robust, but that's work, and gives
us slightly less confidence

## Checklist

- [-] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [-] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [-] I have not broken the cheatsheet
  • Loading branch information
pokey authored Apr 27, 2024
1 parent a02b6a6 commit cb042d6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function assertCalledWithScopeInfo<T extends ScopeTypeInfo>(
fake: sinon.SinonSpy<[scopeInfos: T[]], void>,
...expectedScopeInfos: T[]
) {
await sleepWithBackoff(25);
await sleepWithBackoff(100);
sinon.assert.called(fake);

for (const expectedScopeInfo of expectedScopeInfos) {
Expand All @@ -26,7 +26,7 @@ export async function assertCalledWithoutScopeInfo<T extends ScopeTypeInfo>(
fake: sinon.SinonSpy<[scopeInfos: T[]], void>,
...scopeTypes: ScopeType[]
) {
await sleepWithBackoff(25);
await sleepWithBackoff(100);
sinon.assert.called(fake);

for (const scopeType of scopeTypes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getCursorlessApi, openNewEditor } from "@cursorless/vscode-common";
import { stat, unlink, writeFile } from "fs/promises";
import * as sinon from "sinon";
import { commands } from "vscode";
import { sleepWithBackoff } from "../../endToEndTestSetup";
import {
assertCalledWithScopeInfo,
assertCalledWithoutScopeInfo,
Expand All @@ -35,14 +34,12 @@ export async function runCustomRegexScopeInfoTest() {
cursorlessTalonStateJsonPath,
JSON.stringify(spokenFormJsonContents),
);
await sleepWithBackoff(50);
await assertCalledWithScopeInfo(fake, unsupported);

await openNewEditor(contents);
await assertCalledWithScopeInfo(fake, present);

await unlink(cursorlessTalonStateJsonPath);
await sleepWithBackoff(100);
await assertCalledWithoutScopeInfo(fake, scopeType);
} finally {
disposable.dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ScopeTypeInfo, sleep } from "@cursorless/common";
import * as sinon from "sinon";
import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo";
import { stat, unlink, writeFile } from "fs/promises";
import { sleepWithBackoff } from "../../endToEndTestSetup";

/**
* Tests that the scope provider correctly reports custom spoken forms
Expand Down Expand Up @@ -31,7 +30,6 @@ export async function runCustomSpokenFormScopeInfoTest() {
cursorlessTalonStateJsonPath,
JSON.stringify(spokenFormJsonContents),
);
await sleepWithBackoff(50);
await assertCalledWithScopeInfo(
fake,
subjectCustom,
Expand All @@ -43,7 +41,6 @@ export async function runCustomSpokenFormScopeInfoTest() {
);

await unlink(cursorlessTalonStateJsonPath);
await sleepWithBackoff(100);
await assertCalledWithScopeInfo(
fake,
roundStandard,
Expand Down

0 comments on commit cb042d6

Please sign in to comment.