Closed (fixed)
Project:
Services
Version:
7.x-3.2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2012 at 12:17 UTC
Updated:
4 Dec 2012 at 21:55 UTC
Jump to comment: Most recent file
Implementing tests that extends ServicesWebTestCase, I discovered that calling servicesGet after servicesPut causes Curl to complain about the CURLOPT_INFILE resources file disappearing.
As there seems to be no way to unset the given option in the reused curl resource, I've worked around the issue by creating a new curl resource whenever the previous request used CURLOPT_INFILE but the current doesn't. Not very elegant, but it eliminates the warning.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | services-infile_handling-1842574-8.patch | 1.48 KB | xen |
| infile_handling.patch | 1020 bytes | xen |
Comments
Comment #1
kylebrowning commentedComment #3
kylebrowning commentedthis breaks multiple tests :/
You should just overwrite the setUp() method in your own testCaseClass
Comment #4
xen commentedI cannot just override setUp(), as it's the curlExec() method that's the issue.
Are you seriously suggesting that anyone that writes a service test that might trying to GETting something after PUTting/POSTing something, should override curlExec() in order to work around this issue?
Comment #5
kylebrowning commentedNo, Im saying if you subclass ServicesWebTestCase in your own tests, and write your own setUp method that includes this code
Your tests will pass without warnings, and Services tests wont break.
Comment #6
xen commentedNo it wont, the setUp() method is called before each testSomething() method, but if testSomething() includes code ala:
then the curlHandle *wont* be re-initialized, as setUp() isn't called in between the calls, and the warnings will occur.
Comment #7
kylebrowning commentedFor some reason looking at the patch I thought your code was in the setUp method.
Im fine with this but i t needs to pass all tests and currently it introduces 12 fails and 8 exceptions.
Comment #8
xen commentedFigured it out. When re-initializing Curl, it's cookie state got lost, loosing the session cookie. Which resulted in access denied.
New patch which uses a cookie file to store cookies between Curl sessions.
Comment #9
kylebrowning commentedThere we go, thanks Xen, sorry for the miscommunication.
Comment #10
kylebrowning commentedFixed in dev, will be in 3.4