Skip to content

Commit

Permalink
test: increase timeouts for slow hdd
Browse files Browse the repository at this point in the history
  • Loading branch information
senyai committed Jun 20, 2023
1 parent f8449a8 commit 65272ab
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/test/suite/commitSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function CommitSuite(this: Suite): void {
await commands.executeCommand('fossil.commitWithInput');
sinon.assert.calledOnce(sib);
sinon.assert.calledOnce(commitStub);
});
}).timeout(6000);

test('Commit creating new branch', async () => {
const rootUri = workspace.workspaceFolders![0].uri;
Expand Down Expand Up @@ -192,7 +192,7 @@ export function CommitSuite(this: Suite): void {

await commands.executeCommand('fossil.commitBranch');
sinon.assert.calledOnce(commitStub);
});
}).timeout(6000);

test('Unsaved files warning', async () => {
const uri1 = await add('warning1.txt', 'data', 'warning test');
Expand Down
13 changes: 11 additions & 2 deletions src/test/suite/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Model } from '../../model';
import { Repository } from '../../repository';
import { OpenedRepository, ResourceStatus } from '../../openedRepository';
import { FossilResourceGroup } from '../../resourceGroups';
import { delay } from '../../util';

export async function cleanRoot(): Promise<void> {
/* c8 ignore next 5 */
Expand Down Expand Up @@ -218,8 +219,16 @@ export async function fossilOpenForce(
rootPath.fsPath as FossilCWD,
['open', fossilPath.fsPath, '--force']
);
const res = await executable.exec(rootPath.fsPath as FossilCWD, ['info']);
assert.match(res.stdout, /check-ins:\s+1\s*$/);
// on some systems 'info' is not available immediately
let res: IExecutionResult;
for (let i = 0; i < 10; ++i) {
res = await executable.exec(rootPath.fsPath as FossilCWD, ['info']);
if (/check-ins:\s+1\s*$/.test(res.stdout)) {
break;
}
await delay((i + 1) * 111);
}
assert.match(res!.stdout, /check-ins:\s+1\s*$/);
execStub.restore();
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/suite/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ suite('Setup', () => {
thrown.stderr
);
});
}).timeout(7000);
}).timeout(17000);
});
suite('Clone', function () {
test('Empty URI', async () => {
Expand Down
6 changes: 3 additions & 3 deletions src/test/suite/test_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ export function fossil_merge_suite(sandbox: sinon.SinonSandbox): void {

await repository.updateModelState();
assertGroups(repository, new Map(), new Map());
});
}).timeout(5000);
test('Integrate', async () => {
const repository = getRepository();
await cleanupFossil(repository);
Expand Down Expand Up @@ -950,7 +950,7 @@ export function fossil_rename_suite(sandbox: sinon.SinonSandbox): void {
new Map([[newFilePath.fsPath, ResourceStatus.RENAMED]]),
new Map()
);
});
}).timeout(6000);

test('Rename directory', async () => {
const oldDirname = 'not_renamed';
Expand Down Expand Up @@ -1005,7 +1005,7 @@ export function fossil_rename_suite(sandbox: sinon.SinonSandbox): void {
ResourceStatus.RENAMED,
]);
assertGroups(repository, new Map(ref), new Map());
});
}).timeout(10000);

test('Relocate', async () => {
const repository = getRepository();
Expand Down
2 changes: 1 addition & 1 deletion src/test/suite/utilitiesSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function undoSuite(this: Suite) {
showInformationMessage.secondCall.args[0],
`Redo 'fossil clean ${undoTxtPath}'?`
);
}).timeout(2000);
}).timeout(7000);
}

export function utilitiesSuite(this: Suite): void {
Expand Down

0 comments on commit 65272ab

Please sign in to comment.