[LRUG] Making Rails time out
Simon Morley
simon at polkaspots.com
Fri Apr 19 07:54:22 PDT 2013
A long sleep is indeed required and I was (probably sadly) interested in
your question :) We've struggled with this too and I had not found a
solution.
On a side note, if you're lagging this Friday, watch what happens when you
wring out a washcloth in space. Kept me awake for 3 mins at least. (From
ycombinator.)
io9.com/watch-what-happens-when-you-wring-out-a-washcloth-in-sp-476159356
On 19 April 2013 15:45, Rob Anderson <
rob.anderson at paymentcardsolutions.co.uk> wrote:
> Thanks Tom - that would indeed be the perfect solution, but we're deployed
> on Apache sadly.
>
> But I think you're right that this is a web server thing rather than a
> Rails thing. A long sleep is probably the answer. As it often is on a
> Friday afternoon.
>
>
> On 19 Apr 2013, at 15:34, Mr Jaba <the.jaba at gmail.com> wrote:
>
> This looks like a potential solution:
>
>
> http://stackoverflow.com/questions/2570489/is-there-anyway-to-make-a-rails-rack-application-tell-the-web-server-to-drop-t
>
> Return a special status code to Nginx which will then silently drop the
> connection. I think with Rails it will always want to return some kind of
> response unless you do the sleep, so you might have to do this at the web
> server level.
>
>
>
>
> On 19 April 2013 15:31, Rob Anderson <
> rob.anderson at paymentcardsolutions.co.uk> wrote:
>
>> Yes, this would be a good way of implementing the test if I were writing
>> the client. But I'm actually providing the service.
>>
>> This probably falls into the class of tests which it is the client's
>> responsibility to implement / simulate. But in our particular case it
>> would be handy to have the server be able to do this.
>>
>>
>> On 19 Apr 2013, at 15:22, George Drummond <drummond at rentify.com> wrote:
>>
>> If you are testing this in your test suite then use WebMock to mock a
>> timeout
>>
>> https://github.com/bblimke/webmock/issues/16
>>
>>
>> On 19 Apr 2013, at 15:07, Rob Anderson <
>> rob.anderson at paymentcardsolutions.co.uk> wrote:
>>
>> Hello LRUG
>>
>> I have a weird requirement and I can't seem to figure out how to fulfill
>> it using Rails.
>>
>> We provide a number of web services to third parties. As part of their
>> testing and accreditation with us they need to execute a variety of test
>> cases.
>>
>> Some of the key test conditions involve making sure that exceptions are
>> correctly handled. So if for example they call one of our services and we
>> return a 500 system exception, they handle this gracefully.
>>
>> One of the test cases we have come up with is what happens if our service
>> just fails to respond at all - eg we accept the connection and then leave
>> them hanging waiting for a response. This should raise a client timeout
>> and they should handle it appropriately.
>>
>> But it s not at all clear how to achieve this in our test system. I
>> could put in some monster sleep command, but I don't really want to block
>> the process - ideally I just want to tell ActionController: forget it, your
>> work is done.
>>
>> I suspect maybe this is very difficult / impossible because Apache /
>> Passenger would also need to be told to stand down, but I don't know.
>> Can't find anything on Google either.
>>
>> Perhaps this is just an insane test case - but I know I have seen plenty
>> of instances of this happening in the real world when we call other
>> people's web services, so it would be good to be able to simulate it.
>>
>> Any thoughts gratefully received
>>
>> Rob
>>
>>
>>
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
>>
>>
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
--
Simon Morley
simon at PolkaSpots.com
020 7183 1471
PolkaSpots Supafly Wi-Fi
Follow our updates on twitter: twitter.com/polkaspots
PolkaSpots Supafly blog: polkaspots.com/blog
Learn more about the digital world at simonmorley.co.uk
---------------------------------------------------------------------------------------
The information contained in this email and its attachments is confidential and may be the subject of legal, professional or other privilege. It is intended only for the named addressees and may not be disclosed to anyone else without consent from PolkaSpots Limited. If you are not the named addressee you must not use, disclose, distribute, copy, print or rely on the contents of this email and should destroy it immediately. Whilst PolkaSpots Limited takes care to protect its systems from electronic virus attack or other harmful event, the firm gives no warranty that this email message (including any attachments to it) is free of any virus or other harmful matter and accepts no responsibility for any loss or damage resulting from the recipient receiving, opening or using it. If you need any further information, please contact the originator of this message on +44 (0) 20 7183 1471.
PolkaSpots Limited is registered in the UK, number 05508105. Registered Office: 62 Britton Street (behind the bike sheds), Clerkenwell, London EC1M 5UY
Website: polkaspots.com
WiFi Shop: shop.polkaspots.com
Blog: polkaspots.com/blog
---------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130419/98fb41c2/attachment-0003.html>
More information about the Chat
mailing list