Pact client doesn't send DELETE requests with body correctly
See original GitHub issueSoftware versions
- OS: Windows 10
- Library version: 9.0.4
- Node Version: 10.15.3
Expected behaviour
Pact mock client during pact provider tests should send HTTP DELETE requests with HTTP body correctly.
Actual behaviour
It doesn’t send HTTP DELETE requests correctly.
I’m using Node.js with Express framework as the server, and I’m running pact provider tests / pact verifications. One of the pact interactions is a DELETE request that has a request body (The spec does not forbid it). All other requests go through fine, but the delete request seemingly makes the server freeze and not return anything until the timeout, at which it resets the HTTP connection (see the pact provider log attached).
Upon further investigation with Wireshark I found out the underlying problem: the pact mock client doesn’t even send all of the TCP packets that make up the HTTP DELETE request - it stops short of sending the body. This makes the server wait for the remaining packet, which never comes, thus hanging the test until it times out.
Interestingly, it does send Content-Length: 15
in the first packet, indicating that there will be a body in the following packet(s), but it never sends it.
Steps to reproduce
Try to verify a pact with the following interaction:
{
"description": "A DELETE request to delete one reminder",
"providerState": "User user1@example.com exists with 2 smart reminders",
"request": {
"method": "DELETE",
"path": "/api/users/22/schedule",
"headers": {
"Content-Type": "application/json",
},
"body": {
"items": [
100
]
}
},
"response": {
"status": 204,
"headers": {
}
}
}
(or any pact that has a HTTP DELETE method with a request body).
Relevant log files
Log file generated by pact provider test attached. pact-provider.log
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
Created an issue in
pact-ruby
- https://github.com/pact-foundation/pact-ruby/issues/198Someone else had this issue recently, and I told them I didn’t think it could be fixed. Will have to do a search of all the issues and try and track it down.