Hi guys,
I've been working on a framework that allows uploading a file to a given location. Everything works fine as expected if I run the sample app and manually test this feature, but unit tests for it always fail. Have you ever encountered a similar problem? Is it ever possible to use URLSession with background configuration in XCTest target? I will appreciate any feedback, here's the error message I get when executing a unit test. Note that I put ### for URL keys since it's sensitive data:
failed to create a background NSURLSessionUploadTask, as remote session is unavailable
2023-02-27 11:08:43.082279+0100 xctest[6870:4862390] Task <624B2B68-4A97-4180-A0F8-38AF9ECBC1B7>.<1> finished with error [-1] Error Domain=NSURLErrorDomain Code=-1 "nieznany błąd" UserInfo={NSErrorFailingURLStringKey=###, NSErrorFailingURLKey=###, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"BackgroundUploadTask <624B2B68-4A97-4180-A0F8-38AF9ECBC1B7>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundUploadTask <624B2B68-4A97-4180-A0F8-38AF9ECBC1B7>.<1>, NSLocalizedDescription=nieznany błąd}