Skip to content

Stabilize service tests across Gradle working directories and relax flaky FilePoller benchmark#461

Merged
tryigit merged 3 commits into
masterfrom
copilot/stabilize-daemon-resilience-tests
Mar 8, 2026
Merged

Stabilize service tests across Gradle working directories and relax flaky FilePoller benchmark#461
tryigit merged 3 commits into
masterfrom
copilot/stabilize-daemon-resilience-tests

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

The failing coverage here had two edges: service tests were resolving repo fixtures through brittle relative paths that changed with Gradle’s working directory, and the API 32 instrumentation benchmark was failing on slower emulators despite still using FileObserver rather than the 5s polling fallback.

  • Test fixture lookup

    • Added a shared service-test helper that resolves module/template/* by walking upward from user.dir until the repo fixture is found.
    • Replaced hard-coded ../module/template/... usage in daemon resilience and sepolicy tests.
  • Daemon restart safety coverage

    • Kept the existing daemon resilience assertions intact.
    • Added an explicit assertion that service.sh launches ./daemon and that the daemon wrapper targets MainKt, so non-zero exits remain covered by the retry loop.
    • Removed the unused exitProcess import from Main.kt to satisfy the safety gate cleanly.
  • Instrumentation benchmark stability

    • Increased the FilePollerInstrumentationTest detection timeout from 1500ms to 2500ms.
    • The threshold remains materially below the 5000ms fallback polling interval, so the test still distinguishes FileObserver behavior from polling.

Example of the fixture resolution change:

internal fun moduleTemplateFile(name: String): File {
    val workingDir = File(System.getProperty("user.dir")).absoluteFile
    return generateSequence(workingDir) { it.parentFile }
        .map { File(it, "module/template/$name") }
        .firstOrNull(File::exists)
        ?: error("Could not locate module/template/$name from ${workingDir.absolutePath}")
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@appwrite
Copy link
Copy Markdown

appwrite Bot commented Mar 8, 2026

Yiğit

Project ID: 67b294d30004942511a5

Functions (1)
Function ID Status Logs
 Bootloader Hook 67b296050015d6532253 Queued Queued View Logs

Tip

Build commands execute in runtime containers during deployment

Copilot AI and others added 2 commits March 8, 2026 16:56
Co-authored-by: tryigit <40565628+tryigit@users.noreply.github.com>
Co-authored-by: tryigit <40565628+tryigit@users.noreply.github.com>
Copilot AI changed the title [WIP] Stabilize daemon resilience tests across Gradle working directories Stabilize service tests across Gradle working directories and relax flaky FilePoller benchmark Mar 8, 2026
@tryigit tryigit marked this pull request as ready for review March 8, 2026 17:11
@tryigit tryigit merged commit de2e0ba into master Mar 8, 2026
14 of 15 checks passed
@tryigit tryigit deleted the copilot/stabilize-daemon-resilience-tests branch March 8, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants