From 1d257e8bb68e5d02e363b3fa7b1643ad408d5f74 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sat, 10 Oct 2026 20:11:38 -0700 Subject: [PATCH] Fix spurious unit test failures --- .../kotlin/com/faceclaw/app/PreviewAnimationListenerTest.kt | 6 ++++-- .../kotlin/com/faceclaw/app/GlassesSessionCoreTest.kt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/kotlin/src/androidHostTest/kotlin/com/faceclaw/app/PreviewAnimationListenerTest.kt b/tests/kotlin/src/androidHostTest/kotlin/com/faceclaw/app/PreviewAnimationListenerTest.kt index 9a573d88..0ecd9f64 100644 --- a/tests/kotlin/src/androidHostTest/kotlin/com/faceclaw/app/PreviewAnimationListenerTest.kt +++ b/tests/kotlin/src/androidHostTest/kotlin/com/faceclaw/app/PreviewAnimationListenerTest.kt @@ -10,9 +10,11 @@ import kotlin.test.* */ class PreviewAnimationListenerTest { // FrameDisplayListTest's menu golden (a 2x2 highlight sliding in to rest at (3, 2)), - // restarted at 0 of its 240 ms so the slide is still in flight at the first pull. + // restarted at 1 of its 240 ms so the slide is still in flight at the first pull. Not 0: + // at exactly 0 the highlight is wholly above this 8x8 screen, so a pull in the same + // millisecond as the submit (a warm JIT) would match the settled frame. private val menu = "077f0000000300020002000200022a00000096000000010002000200ffffffff0200080000ff24017e30020000000001812c8001812c1611010017328001812c16103001812c3023414031ff24017c30020000000001812c8001812c1611010017328001812c16103001812c30234140310200020001000103100400000000000000001f" - .chunked(2).map { it.toInt(16).toByte() }.toByteArray().also { it.fill(0, 18, 22) } + .chunked(2).map { it.toInt(16).toByte() }.toByteArray().also { it.fill(0, 18, 22); it[18] = 1 } private fun settledPreview(): ByteArray { val reader = ArrayByteReader(menu) diff --git a/tests/kotlin/src/commonTest/kotlin/com/faceclaw/app/GlassesSessionCoreTest.kt b/tests/kotlin/src/commonTest/kotlin/com/faceclaw/app/GlassesSessionCoreTest.kt index 00604823..a615af76 100644 --- a/tests/kotlin/src/commonTest/kotlin/com/faceclaw/app/GlassesSessionCoreTest.kt +++ b/tests/kotlin/src/commonTest/kotlin/com/faceclaw/app/GlassesSessionCoreTest.kt @@ -453,7 +453,7 @@ class GlassesSessionCoreTest { s.core.interruptibleSleep.interrupt() assertTrue(waitUntil(3_000) { s.listener.phases.contains("retrying") }, s.host.logs().takeLast(10).toString()) assertTrue(s.host.hasLog("message timed out: create-layout")) - assertTrue(s.host.hasLog("Transport failure: ack timeout")) + assertTrue(s.host.hasLog("Transport failure: create layout ack timeout")) assertTrue(s.link.disconnected.containsAll(listOf(RIGHT, LEFT))) s.core.disconnect() assertEquals("disconnected", s.listener.phases.last())