Repository navigation
Test that reusing or cancelling an image view interrupts the request - #429
Merged
Merged
Conversation
The tests that exist showed that the completion does not fire once a load is superseded. These check the request itself is interrupted, for the UIKit and AppKit integrations. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A caller that waited for a busy client to free up would wait for a 60 s request or for ever; a loaded Linux runner takes over a second (1.33 s and 1.02 s seen) on a call that only does bookkeeping. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
==========================================
+ Coverage 94.61% 94.63% +0.01%
==========================================
Files 464 464
Lines 19367 19367
==========================================
+ Hits 18324 18327 +3
+ Misses 1043 1040 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Tests that a reused or cancelled image view interrupts its request. (Audit E18, the "UIKit, AppKit and WatchKit integrations were not read" part.) Tests only, no source change.
The tests that existed show that the completion does not fire once a load is superseded or cancelled. That does not show the request stopped: the stub was a sleep that finished on its own. The new ones use a task that sleeps for 60 s and records that it was cancelled, and wait for that with
eventually(bounded):reusingTheImageViewInterruptsTheRequestOfThePreviousLoad: a secondsetImageon the same view interrupts the first request.cancelInterruptsTheRequestOfThePendingLoad:cancel()does.For
UIImageViewandNSImageView.What reading the three integrations showed
UIImageView,NSImageViewandWKInterfaceImageare the same code apart from the types:setImagecancels the load in flight on that view first, andcancel()is public;setImage: the caller has to callcancel()(inprepareForReuse, say). The task holds the view strongly, and the view holds the task, so adeinitcould not do it either, and the view lives until its load ends;WKInterfaceImagehas no test target here; its code is identical to the other two.None of that is changed here.
Checked
cancel()from cancelling the task: both new tests fail after the 10 s limit, with the two old ones.NSImageViewRequestDLTestspasses on macOS;UIImageViewRequestDLTestspasses on the iPad Air 11-inch (M4) simulator.swift format lint --strictis clean onTests/RequestDLTests/Image.🤖 Generated with Claude Code