Skip to content

fix(ios-tests): reduce testCleanResyncGhosts flakiness#479

Merged
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:fix-clean-resync-ghosts-flakiness
Jul 7, 2026
Merged

fix(ios-tests): reduce testCleanResyncGhosts flakiness#479
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:fix-clean-resync-ghosts-flakiness

Conversation

@wmathurin

Copy link
Copy Markdown
Contributor

Summary

  • Parallelize independent netCreate calls — the two contacts are independent; running them with Promise.all saves one full server RTT off the critical path
  • Add 1s pause after netDel before cleanResyncGhosts — Salesforce has eventual consistency; the deletion needs a moment to propagate before the ghost-detection query runs (mirrors the existing pattern in testReSync)
  • Add .catch() handler — without it, any transient network error causes the test to hang silently for the full 120s XCUITest timeout instead of failing immediately with a useful message
  • Fix wrong assertion message'Total size should be 1''Total size should be 2'

Context

testCleanResyncGhosts has been the sole flapping test in the iOS suite for a while. It timed out in CI on both the ^18 and ^26 legs of PR #477. The test makes 6+ sequential network calls to a live Salesforce org; on a slow CI runner that easily lands on or past the 120s XCUITest timeout. The parallel creates address the root timing cause; the .catch() ensures that if it does time out in future, the failure is reported immediately with a message rather than as an opaque hang.

Test plan

  • Run iosTests locally: xcodebuild test -workspace SalesforceReactTestApp.xcworkspace -scheme SalesforceReactTestApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro'
  • Confirm testCleanResyncGhosts passes and completes faster than before
  • Confirm all other MobileSync tests still pass

- Parallelize the two independent netCreate calls to save one RTT
- Add 1s pause after netDel before cleanResyncGhosts to allow deletion
  to propagate on the server (mirrors the pattern in testReSync)
- Add .catch() so transient errors fail fast with a message instead of
  hanging for the full 120s XCUITest timeout
- Fix wrong assertion message ('should be 1' → 'should be 2')
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
iOS ^18 Test Results35 ran35 ✅
TestResult
No test annotations available

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
iOS ^26 Test Results35 ran35 ✅
TestResult
No test annotations available

@wmathurin
wmathurin merged commit e0f4551 into forcedotcom:dev Jul 7, 2026
7 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