From 3d0e09b0c60aeae3d796295c1220b1e7dc5297fa Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sat, 20 Jun 2026 22:33:34 -0700 Subject: [PATCH] Relax e2e flood -> pathed requirements to not need literal direct --- tests/e2e/specs/dev-flightless-direct-route.spec.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/dev-flightless-direct-route.spec.ts b/tests/e2e/specs/dev-flightless-direct-route.spec.ts index 77724b8..937c83d 100644 --- a/tests/e2e/specs/dev-flightless-direct-route.spec.ts +++ b/tests/e2e/specs/dev-flightless-direct-route.spec.ts @@ -109,6 +109,14 @@ test.describe('Partner-radio direct-route learning via DM ACK', () => { ) .toBeGreaterThan(0); + // We send zero-hop adverts so the partner ideally hears us directly and the + // learned return route is zero-hop (direct_path_len === 0, empty path bytes). + // But mesh RF is nondeterministic: depending on link quality and timing, the + // partner may hear our advert (or route its ACK back) via a repeater, in + // which case the legitimately-learned direct route is 1+ hops with non-empty + // path bytes. The point of this test is that the DM ACK learns a *direct* + // route off flood, not that it is specifically zero-hop, so assert "off + // flood" (direct_path_len >= 0) rather than an exact hop count. await expect .poll( async () => { @@ -120,10 +128,10 @@ test.describe('Partner-radio direct-route learning via DM ACK', () => { message: 'Waiting for partner radio route to update from flood to direct', } ) - .toBe(0); + .toBeGreaterThanOrEqual(0); const learnedContact = await getContactByKey(E2E_PARTNER_RADIO_PUBKEY); - expect(learnedContact?.direct_path ?? '').toBe(''); + expect(learnedContact?.direct_path_len ?? -1).toBeGreaterThanOrEqual(0); await page.locator('[title="View contact info"]').click(); await expect(page.getByLabel('Contact Info')).toBeVisible({ timeout: 15_000 });