Conversation
…tor job out `EditorLocalizationTests` reads its reports back with `OSLogStore`, a synchronous round trip to the log daemon, and did so on the main actor. On a loaded machine the daemon can take minutes to answer. For as long as it did, no other main-actor test in the run could make progress, and the ones waiting on a deadline failed. The read now runs on a thread of its own and gives up after 30 seconds. Each test restores the global localization state before it reads, so none holds that state across a suspension. The iOS Simulator job also gets a 20-minute timeout. A run whose main thread is stuck neither fails nor finishes, and one held its agent for 48 minutes.
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/754")Built from c4e9793 |
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.
EditorLocalizationTestsreads its missing-translation reports back out of the system log withOSLogStore. That read is a synchronous round trip to the log daemon, and the suite made it on the main actor. While the daemon takes its time, no other@MainActortest in the run can make progress, and the ones waiting on a deadline fail.Changes
missingTranslationReports(forKeyNamed:since:)is nownonisolatedandasync. The read runs on a dispatch queue, and the test stops waiting for it — and fails, saying so — if the daemon hasn't answered in time. AdispatchPreconditionkeeps the read from moving back to the main queue.withLocalization. The read now comes after, so no test holdsEditorLocalization.localizeorEditorLogger.sharedacross a suspension, where another suite's main-actor test could run against them.How we found it
Running the simulator suite with a development machine's CPUs saturated stalled it.
sampleon thexctestprocess showed the main thread in one place for all 2,665 samples:Three
@MainActorsuites were still unfinished four minutes in. WithEditorLocalizationTestsskipped, the same run under the same load passed in 7 seconds. Both runs were on #747's branch.This is not what stalled #747's simulator job for 46 minutes. That was Swift Testing working out the difference between two megabyte payloads after a failed
==, fixed on that branch in 9bba62d. The job timeout here bounds either kind of stall.Test plan
swift test --filter EditorLocalizationTests: 8 tests pass.The log store didn't answer within 1 seconds, and the other four pass.EditorLocalizationTests.swift, and Prettier on.buildkite/pipeline.yml.