mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
test(street-level): the gate waits for image cones to become pickable
On CI's SwiftShader the ground-clamped cones take a few frames after a sequence is selected; a single pick search found none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
a536e7879c
commit
4e2e0d6900
1 file changed
+5
-3
@@ -356,11 +356,11 @@ const findPick = (page, prefix, { box = null, step = 3 } = {}) =>
|
||||
async function findPickUntil(
|
||||
page,
|
||||
prefix,
|
||||
{ timeout = 30_000, box = null } = {},
|
||||
{ timeout = 30_000, box = null, step } = {},
|
||||
) {
|
||||
const deadline = Date.now() + timeout;
|
||||
for (;;) {
|
||||
const hit = await findPick(page, prefix, { box });
|
||||
const hit = await findPick(page, prefix, { box, step });
|
||||
if (hit || Date.now() >= deadline) return hit;
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
}
|
||||
@@ -607,7 +607,9 @@ async function main() {
|
||||
page,
|
||||
(u) => u.sequence.selectedId && !u.sequence.loading,
|
||||
);
|
||||
const cone = await findPick(page, 'mly:img:', {
|
||||
// Cones clamp to the ground: on a slow GPU (CI's SwiftShader) they
|
||||
// can take a few frames after the selection to become pickable.
|
||||
const cone = await findPickUntil(page, 'mly:img:', {
|
||||
box: {
|
||||
x: Math.max(0, line.local.x - 150),
|
||||
y: Math.max(0, line.local.y - 150),
|
||||
|
||||
Reference in new issue
Block a user