Skip to content

Simulate sleep in apply before posting back to main#5297

Merged
marta-lokhova merged 1 commit into
stellar:masterfrom
marta-lokhova:simulateApplyFix
May 28, 2026
Merged

Simulate sleep in apply before posting back to main#5297
marta-lokhova merged 1 commit into
stellar:masterfrom
marta-lokhova:simulateApplyFix

Conversation

@marta-lokhova
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 23:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts where test-only ledger-apply sleep simulation occurs so that the simulated delay happens before applyLedger publishes results back to the main thread (or advances state directly when already on main). This better aligns the “simulated apply time” with the point at which the main thread observes ledger-apply completion.

Changes:

  • Move maybeSimulateSleep(...) (BUILD_TESTS-only) to run before advanceLedgerStateAndPublish / postOnMainThread.
  • Preserve the existing sleep-duration calculation logic (based on op count and elapsed apply time so far).

@marta-lokhova marta-lokhova enabled auto-merge May 27, 2026 23:59
@marta-lokhova marta-lokhova added this pull request to the merge queue May 28, 2026
Merged via the queue into stellar:master with commit ade8c25 May 28, 2026
68 checks passed
@marta-lokhova marta-lokhova deleted the simulateApplyFix branch May 28, 2026 01:27
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