Skip to content

Commit de3ad2f

Browse files
authored
fix(ci): pause search clock without wall-time races (#9695)
1 parent ad5ed28 commit de3ad2f

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎apps/sim/lib/sim-links/application/use-cases.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ export const listSimLinks = defineAuthorizedOrganizationUseCase({
194194
},
195195
})
196196

197-
/**
198-
* One link by id or by name as typed. Hidden exactly as browsing hides it: an unlisted link reads
199-
* as missing to anyone who cannot manage it.
200-
*/
201197
async function findLinkIdByName(organizationId: string, typedName: string) {
202198
const link = await repository.findSimLinkDestination(
203199
organizationId,
@@ -206,6 +202,10 @@ async function findLinkIdByName(organizationId: string, typedName: string) {
206202
return link?.id
207203
}
208204

205+
/**
206+
* One link by id or by name as typed. Hidden exactly as browsing hides it: an unlisted link reads
207+
* as missing to anyone who cannot manage it.
208+
*/
209209
export const getSimLinkView = defineAuthorizedOrganizationUseCase({
210210
operation: simLinkOperations.get,
211211
...rollout,

‎apps/sim/scripts/test-organization-search-e2e.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,9 @@ try {
708708
await navigation.getByRole('button', { name: 'Search', exact: true }).click()
709709
await expect(page).toHaveURL((url) => url.searchParams.get('mode') === 'search')
710710
}
711-
await page.clock.pauseAt(new Date(Date.now() + 100))
711+
const pausedAt = new Date()
712+
await page.clock.setFixedTime(pausedAt)
713+
await page.clock.pauseAt(pausedAt)
712714
const selected = navigation.getByRole('button', {
713715
name: selectedMode === 'assistant' ? 'Assistant' : 'Search',
714716
exact: true,
@@ -726,6 +728,7 @@ try {
726728
} finally {
727729
admission.resolve()
728730
heldAdmission = undefined
731+
await page.clock.setSystemTime(new Date())
729732
await page.clock.resume()
730733
}
731734
}

0 commit comments

Comments
 (0)