mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-11-06 04:14:18 +00:00
fix: preserve weak release check without mutable local
This commit is contained in:
+3
-4
@@ -95,7 +95,7 @@ extension SubscriptionAutoUpdateWorkflowTests {
|
||||
clockReads += 1
|
||||
return fixture.now
|
||||
})
|
||||
weak var releasedWorkflow = workflow
|
||||
let workflowIsReleased = { [weak workflow] in workflow == nil }
|
||||
defer {
|
||||
workflow?.stopSubscriptionAutomaticUpdates()
|
||||
fetcher.releaseAll()
|
||||
@@ -106,9 +106,8 @@ extension SubscriptionAutoUpdateWorkflowTests {
|
||||
workflow?.stopSubscriptionAutomaticUpdates()
|
||||
workflow = nil
|
||||
fetcher.releaseAll()
|
||||
try await requireTestCondition("stopped batch released its workflow") {
|
||||
releasedWorkflow == nil
|
||||
}
|
||||
try await requireTestCondition(
|
||||
"stopped batch released its workflow", condition: workflowIsReleased)
|
||||
#expect(clockReads == readsBeforeStop)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user