Skip to content

Fix expression caching within polling attempts - #1214

Open
GtechGovind wants to merge 1 commit into
Quick:mainfrom
GtechGovind:fix/polling-attempt-expression-cache
Open

GtechGovind wants to merge 1 commit into
Quick:mainfrom
GtechGovind:fix/polling-attempt-expression-cache

Conversation

@GtechGovind

Copy link
Copy Markdown

Fixes #360.

I reproduced a polling failure where the matcher result and diagnostic observed different values from the same expression. The expression could be evaluated more than once during a single polling attempt.

I added a fresh expression cache for each polling attempt across synchronous, async, and require expectations. Matchers reuse a value within an attempt, while subsequent attempts still observe changes. The async-to-synchronous conversion already materializes its expression once, so I left that path unchanged.

I added regressions for changing expressions, async matchers that evaluate twice, returned require values, and continuous always/never polling, and documented the caching boundary.

Validation:

  • Focused polling matrix: 89 tests passed.
  • New async/require regressions: 3 passed; continuous-polling regression: 1 passed.
  • Full SwiftPM: 383 Swift and 94 Objective-C tests passed, plus Swift Testing support checks with their expected known issues.
  • macOS Xcode tests: 488 passed, 4 expected failures.
  • iOS simulator Xcode tests: 488 passed, 4 expected failures, including the continuous-polling regression.
  • git diff --check passed.

Installed Xcode required command-only deployment-target overrides (macOS 12 and iOS 15); I did not change the project's supported versions. Other platforms and the repository's CI toolchain matrix remain for CI.

@GtechGovind
GtechGovind marked this pull request as ready for review October 17, 2026 06:44

This branch has not been deployed

No deployments
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.

Test fails: "expected to eventually be true, got <true>"

1 participant