fix
parent
4959eeb821
commit
811e2a6e65
|
|
@ -5690,7 +5690,7 @@ class SharedWorkspaceLocking {
|
||||||
}
|
}
|
||||||
static DoesCacheKeyTopLevelExist(buildParametersContext) {
|
static DoesCacheKeyTopLevelExist(buildParametersContext) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const lines = yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`);
|
const lines = yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`);
|
||||||
return lines.map((x) => x.replace(`/`, ``)).includes(buildParametersContext.cacheKey);
|
return lines.map((x) => x.replace(`/`, ``)).includes(buildParametersContext.cacheKey);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -25,7 +25,7 @@ export class SharedWorkspaceLocking {
|
||||||
.filter((x) => x.includes(`_workspace`));
|
.filter((x) => x.includes(`_workspace`));
|
||||||
}
|
}
|
||||||
public static async DoesCacheKeyTopLevelExist(buildParametersContext: BuildParameters) {
|
public static async DoesCacheKeyTopLevelExist(buildParametersContext: BuildParameters) {
|
||||||
const lines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`);
|
const lines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`);
|
||||||
|
|
||||||
return lines.map((x) => x.replace(`/`, ``)).includes(buildParametersContext.cacheKey);
|
return lines.map((x) => x.replace(`/`, ``)).includes(buildParametersContext.cacheKey);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ describe('Cloud Runner Locking', () => {
|
||||||
(await SharedWorkspaceLocking.IsWorkspaceLocked(newWorkspaceName, buildParameters)) === false;
|
(await SharedWorkspaceLocking.IsWorkspaceLocked(newWorkspaceName, buildParameters)) === false;
|
||||||
expect(isExpectedUnlockedBeforeLocking).toBeTruthy();
|
expect(isExpectedUnlockedBeforeLocking).toBeTruthy();
|
||||||
await SharedWorkspaceLocking.LockWorkspace(newWorkspaceName, runId, buildParameters);
|
await SharedWorkspaceLocking.LockWorkspace(newWorkspaceName, runId, buildParameters);
|
||||||
|
const lines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`);
|
||||||
|
expect(lines.map((x) => x.replace(`/`, ``)).includes(buildParameters.cacheKey));
|
||||||
expect(await SharedWorkspaceLocking.DoesCacheKeyTopLevelExist(buildParameters)).toBeTruthy();
|
expect(await SharedWorkspaceLocking.DoesCacheKeyTopLevelExist(buildParameters)).toBeTruthy();
|
||||||
expect(await SharedWorkspaceLocking.DoesWorkspaceExist(newWorkspaceName, buildParameters)).toBeTruthy();
|
expect(await SharedWorkspaceLocking.DoesWorkspaceExist(newWorkspaceName, buildParameters)).toBeTruthy();
|
||||||
const allLocks = await SharedWorkspaceLocking.GetAllLocks(newWorkspaceName, buildParameters);
|
const allLocks = await SharedWorkspaceLocking.GetAllLocks(newWorkspaceName, buildParameters);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue