Skip to content

Stabilize iOS SQLite reservation timeout test#1449

Merged
lalitb merged 5 commits into
mainfrom
copilot/fix-github-actions-build-macos
Jun 1, 2026
Merged

Stabilize iOS SQLite reservation timeout test#1449
lalitb merged 5 commits into
mainfrom
copilot/fix-github-actions-build-macos

Conversation

Copilot AI commented May 27, 2026

Copy link
Copy Markdown
Contributor

The failing macOS/iOS Actions job was caused by a timing-sensitive unit test, not a build break. OfflineStorageTests_SQLite.ReservedRecordsAreReleasedAfterTimeout assumed fixed sleeps were enough for all leases to expire on the simulator, which was not reliably true.

  • Root cause

    • The test used a hard-coded PAL::sleep(2000) after reserving two records with different lease durations.
    • On slower or more variable iOS simulator runs, the later assertion could execute before the longest reserved_until timestamp had actually elapsed.
  • Change

    • Reworked the test to wait on the recorded reservation deadlines instead of wall-clock assumptions.
    • After reserving both records, the test reads the stored records, finds the maximum reservedUntil, and waits until that deadline has passed with a small buffer.
  • Effect

    • Keeps production behavior unchanged.
    • Removes simulator scheduling/timer jitter as a source of false negatives in CI.
auto records = offlineStorage->GetRecords(true, EventLatency_Unspecified, 0);
int64_t waitUntilMs = 0;
for (auto const& record : records)
{
    waitUntilMs = std::max(waitUntilMs, record.reservedUntil);
}

while (PAL::getUtcSystemTimeMs() <= waitUntilMs + 250)
{
    PAL::sleep(50);
}

Copilot AI changed the title [WIP] Fix failing GitHub Actions job for macOS build Stabilize iOS SQLite reservation timeout test May 27, 2026
Copilot finished work on behalf of lalitb May 27, 2026 04:09
Copilot AI requested a review from lalitb May 27, 2026 04:09
@lalitb lalitb marked this pull request as ready for review May 27, 2026 21:27
@lalitb lalitb requested a review from a team as a code owner May 27, 2026 21:27
@lalitb

lalitb commented May 27, 2026

Copy link
Copy Markdown
Contributor

This should be good to merge. I won't be able to merge this, as I triggered copilot to fix the issue,

@lalitb lalitb merged commit 1d8bd6e into main Jun 1, 2026
27 checks passed
@lalitb lalitb deleted the copilot/fix-github-actions-build-macos branch June 1, 2026 19:14
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.

3 participants