Skip to content

Stabilize iOS SQLite reservation timeout test#1449

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-build-macos
Open

Stabilize iOS SQLite reservation timeout test#1449
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-build-macos

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

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
Copy link
Copy Markdown
Contributor

lalitb commented May 27, 2026

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

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