Skip to content

test: Avoid APFS integration timeout - #2452

Merged
shepilov merged 1 commit into
masterfrom
fix/apfs-integration-timeout
Jul 15, 2026
Merged

test: Avoid APFS integration timeout#2452
shepilov merged 1 commit into
masterfrom
fix/apfs-integration-timeout

Conversation

@shepilov

@shepilov shepilov commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Initial problem

The APFS integration job was timing out in test/integration/differential_sync.js for the scenario where a local folder is created with the same path as an excluded remote folder and the user chooses to create a conflict. The failing test waited for local-end only after helpers.local.side.start() had resolved, but start() already waits for the initial scan to finish. The watcher emits local-end before resolving that start() promise, so the test could attach its listener too late and then wait forever until Mocha hit the 20s timeout.

The same race also existed after creating Photos/ and Photos/My Image.png: the listener was registered after the filesystem writes, so a fast watcher could flush the events before the test started waiting.

Changes

  • Remove the redundant local-end wait after helpers.local.side.start().
  • Use a one-shot once('local-end', ...) listener.
  • Register the local watcher completion promise before creating the local folder and file.

Validation

  • ./node_modules/.bin/eslint test/integration/differential_sync.js
  • git diff --check origin/master...HEAD

The targeted APFS integration test was not run locally because this checkout has no .env.test, and no local Cozy stack is running on cozy.localhost:8080 / 127.0.0.1:8080.

@shepilov
shepilov marked this pull request as ready for review July 7, 2026 12:15
Comment thread test/integration/move.js Outdated
Comment thread test/integration/add.js Outdated
Comment thread test/integration/add.js Outdated
Comment thread test/integration/move.js Outdated
@shepilov
shepilov force-pushed the fix/apfs-integration-timeout branch 2 times, most recently from 999233c to 60a10d1 Compare July 9, 2026 14:30
Fix local watcher wait races in integration tests by registering local-end waits before writes and by avoiding a redundant wait after side startup.
@shepilov
shepilov force-pushed the fix/apfs-integration-timeout branch from 60a10d1 to 0dfa6f8 Compare July 10, 2026 07:55
@shepilov
shepilov merged commit 38d0b5a into master Jul 15, 2026
16 of 17 checks passed
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