-
Notifications
You must be signed in to change notification settings - Fork 24
Intermittent failures in Shock v6 #34
Intermittent failures in Shock v6 #34
Conversation
…lates. Added tests.
@@ -26,12 +26,57 @@ class RouteTests: ShockTestCase { | |||
} | |||
|
|||
func testSimpleRouteWithVariables() { | |||
let route: MockHTTPRoute = .simple(method: .get, urlPath: "/simple/:foo", code: 200, filename: "testSimpleRoute.txt") | |||
let route: MockHTTPRoute = .simple(method: .get, urlPath: "/simple/:foo", code: 200, filename: "testSimpleRouteWithVariables.txt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
private func handleResponse(forResponseContext middlewareContext: MiddlewareContext, in channelHandlerContext: ChannelHandlerContext) { | ||
private func handleResponse(forResponseContext middlewareContext: MiddlewareContext, | ||
in channelHandlerContext: ChannelHandlerContext, | ||
version: HTTPVersion) { | ||
|
||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not super clear what is To be done here? Should this comment be updated or even removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
responseFactory: self.responseFactory) | ||
finalMiddleware.insert(routeMiddleware, at: 0) | ||
} | ||
let responder = MiddlwareResponder(middleware: finalMiddleware, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion
let responder = MiddlwareResponder(middleware: finalMiddleware, | |
let responder = MiddlwareResponder(middleware: finalMiddleware, |
Really nice PR @antoniostrijdom - Super clean. |
We were seeing intermittent failures on our CI system for Shock v6.
This PR:
EventLoop
.urlPath
.Hashable
routes in favour of an array of structs mapping routes to hander closures.Equatable
implementation (wasn't dealing with paths with wildcards correctly).