| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
There is something weird with one of the new tests in CircleCI specifically (testShouldHandleTheSameRequestWithDifferentTimeIntervals ) for the Swift Package Manager, it's failing all the time for the second request and locally is working every time for me. I noticed CircleCI is using the Target x86_64-apple-darwin18.2.0 and in my current machine I've x86_64-apple-darwin18.5.0, so I think there is something that was changed. I'm disabling these for the moment and opening it a ticket to keep track of the issue. Once CircleCI update it's target version we can go back and try it again. They mentioned it will be soon once they are ready to support Xcode 10.2.1. In Linux as they are not working at all also. I run it locally with the same Swift 5.0 docker image and both are stuck running. So a ticket will be open to tracking the issue. |
Sorry, something went wrong.
There was a problem hiding this comment.
👍
Sorry, something went wrong.
|
Thanks, @pvzig I want to run some tests again before merging this PR as I found something interesting with the change I didn't saw before. |
Sorry, something went wrong.
* Fix a crash when several request for the same URL are launched concurrently regarding a race condition * Fix an issue in the `testStopActiveConnection` causing the `URLSession.share` singleton was stuck in the thread and it doesn’t work in another tests * Refactor the `SwifterTestsHttpRouter` to reuse the `HttpRouter` object * Add new tests for the threading issue * Include the new tests added to the `XCTManifests.swift` * Update the XCTManifests.swift path in the swiftlint config file * Rename the jobs in CircleCI * Update the swift-tools-version for the `Package.swift`
Fix a crash when several request for the same URL or route are launched together
| Back | FazBrowse Home | New Git URL |
This issue was detected by one of my colleagues during some UI Tests research using Xcode 10.2. When I started to test the branch with the issue using Charles I detected an issue coming from several requests being launched in very close intervals when they belong to similar routers or even the same route.
The issue was causing an EXC_BAD_INSTRUCTION:
Once I enabled the Thread Sanitizer for the test suite I was able to follow the path to localize the issue causing the thread race condition and it was coming from:
swifter/XCode/Sources/HttpServerIO.swift
Line 88 in 70ec292
Apparently, there were some issues during starting and stopping new connections during concurrent requests. I was able to reproduce it in the library simulating several requests concurrent and serial with time differences in the new ServerThreadingTests.
This PR can be resumed in the following steps: