timeout

How to define JUnit test time-out at runtime (i.e. without annotations)?

冷暖自知 提交于 2019-12-12 15:14:18
问题 I want to run a unit test with a time-out that is defined at runtime. I want to define a time-out for a specific test only, not the whole class. I saw these are the ways to set the time out: @Rule public Timeout globalTimeout = new Timeout(10000); // 10 seconds max per method tested or @Test(timeout=100) public void infinity() { while(true); } but when I run this code, no exception is thrown. I want to identify when the test failed due to timeout. public Timeout testTimeout; private void

Timeout Error - Sending mail through SQL Mail - Service Broker Queue

情到浓时终转凉″ 提交于 2019-12-12 14:02:53
问题 This is my first question! So I hope I provide enough information: We are attempting to send around 1000 emails by taking advantage of the SQL Mail Service Broker. We are relatively new to this, but have hit a wall with this problem: Some Background: We created a Profile, an Account and a ProfileAccount entries, and enable database mail. We then tested with a few emails and all worked fine. We then created a store procedure that we would call from our project to QUEUE all the emails using

MessageQueueTransaction timeout

筅森魡賤 提交于 2019-12-12 12:28:51
问题 I read about MessageQueueTransaction in MSDN, but I can't find anything about timeouts. What happens if the Commit or Abort just never get called ? Is there some sort of timeout for a transaction between the time it's open and it's release ? 回答1: This is an internal transaction so doesn't involve MSDTC (which does have a timeout). I believe that the transaction will exist until your application calls commit or abort. If the application fails or exits without calling either then I would expect

Streaming with gunicorn

送分小仙女□ 提交于 2019-12-12 12:27:52
问题 I'm trying to stream data from a flask/gunicorn server: while (True): result = json.dumps(tweetQueue.get()) yield result However, 30 seconds into the stream, gunicorn times out my connection and stops the stream. How can I make the timeout such that publishing new data to the stream from the server will restart the timeout so the stream will not be terminated? Thanks! 回答1: I am answering my own question after doing some more research. gunicorn server:app -k gevent This uses asynchronous

timeout and auto logout in asp.net 2.0 with IIS 7 even after doing all the possible settings

折月煮酒 提交于 2019-12-12 12:15:00
问题 I have an ASP.NET 2.0 web site hosted on Windows Server 2008 with IIS 7. I am using InProc session mode (specified in web.config). My client wants the timeout to be of 3 hours, meaning if the web site is idle, session should remain alive for 3 hours. Currently, what is happening is that if the web site is idle for 20-30 min. and if the user to tries to access any link, it redirects to login page. I searched on internet and did all the possible settings (as follows): In web config, session

Is ruby 2.1.2 timeout still not thread safe?

时间秒杀一切 提交于 2019-12-12 12:14:31
问题 I have 50 sidekiq threads crawling the web, and a few weeks ago the threads started hanging after about 20 minutes of running. When I do a backtrace dump, most of the threads are stuck on net/http initialize: /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `initialize' /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `open' /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `block in connect' /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:76:in `timeout' /app/vendor

Oracle: Set Query Timeout

一曲冷凌霜 提交于 2019-12-12 11:54:45
问题 i have a PL/SQL program which do a query to an AS400 database through Transparent Gateway. Sometimes the AS400 not responds to the query (may be network problems )and the PL/SQL program hangs. Is there any method to set a timeout to the Oracle query so that when certain amount of time passes an exception is risen? 回答1: Have you tried setting the HS_FDS_CONNECT_PROPERTIES parameter in the AS400 Transparent Gateway initialisation file? For a timeout of 2 minutes: HS_FDS_CONNECT_PROPERTIES=

Google App Engine time out?

帅比萌擦擦* 提交于 2019-12-12 10:54:21
问题 In a Google App Engine app I used the following lines to read a page from a site : String Url="http://...",line,Result=""; URL url=new URL(Url+"?r="+System.currentTimeMillis()); BufferedReader reader=new BufferedReader(new InputStreamReader(url.openStream())); while ((line=reader.readLine())!=null) { Result+=line+"\n"; } reader.close(); But I got the following error : Uncaught exception from servlet com.google.apphosting.api.DeadlineExceededException: This request (f5e2889605d27d42) started

jQuery AJAX timeout undefined

本小妞迷上赌 提交于 2019-12-12 10:36:30
问题 I was trying out example jQuery examples and to my surprise, I got an error state for an AJAX call mentioning that timeout isn't defined. When I removed timeout attribute, it worked fine. I downloaded jQuery few days back, so I am pretty sure it's not a version problem. I was trying with Firefox(3.6.8) and not any other browser. Why would this occur? Edit : Code snippet moved from the comments to the question $.ajax({ type: "GET", dataType: 'json', url: PHPServiceProxy, timeout: 5000, success

SqlConnection and TransactionScope Timeout

こ雲淡風輕ζ 提交于 2019-12-12 10:25:03
问题 I have a TransactionScope (over DTC, read committed) with a timeout of 60 minutes. In the TransactionScope I have opened the connection (I hope to enlist in the transaction) but after 30 seconds I get a timeout. In the machine.config I changed the system.transaction maxTimeout to 60 minutes. Why does the timeout occur after 30 seconds? 回答1: A SqlCommand already has a CommandTimeout property that defaults to 30 seconds. May be you are using it within your transaction. 来源: https://stackoverflow