Repository navigation
Time the lost-lease schema cache by the framework clock - #1250
Merged
Merged
Conversation
WorkflowTaskLeaseLoss cached its schema check for 60 s using PHP's time(), which a frozen test clock does not hold. On slow runs the check repeated mid-measurement and query-count tests saw extra queries. Use the Date facade, and re-check once when the clock moves backwards. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes a flaky test on main introduced by #1244:
ChildClosureSiblingHistoryCostTest::testChildClosureQueryCountDoesNotGrowWithFanOut(coverage-unit) saw 159 queries against 157 expected.Cause
WorkflowTaskLeaseLoss::hasColumn()cached its schema check for 60 s using PHP'stime(). Tests freeze the framework clock but nottime(), so on a slow run the 60 s window ran out mid-measurement and the schema check ran again.Change
Date::now()->getTimestamp(), so a frozen test clock holds it.time()-based cache added in 2.34.0. I checked everysrcfile changed between 2.33.0 and 2.34.0.Tests
V2WorkflowTaskLostLeaseTest::testTheSchemaCheckWindowFollowsTheFrameworkClock. With a frozen clock, a 59 s travel issues no schema query and 60 s re-checks; a backwards travel re-checks once and then holds. It fails against thetime()version ("0 is greater than 0") and passes with this change.V2WorkflowTaskLostLeaseTestpasses on SQLite and MySQL 8.4, andChildClosureSiblingHistoryCostTestpasses on SQLite.🤖 Generated with Claude Code