On Tue, Oct 5, 2010 at 5:50 AM, Ed <[email protected]> wrote:

> Yesterday my test was run with success and last night it failed again,
> without anything changing in the meantime :(
>
> I was digging a bit more in the GWT Junit test code and I think the
> test fails because I don't use a servlet that is hosted by the Tomcat
> container started by GWT.
> Like Freeland mentions above, I have to contact the backend within 60
> sec to overcome the timeout exception. I think I have to contact a
> servlet run in the GWT Tomcat instance as otherwise it's not seen as a
> backend contact.
> Is this the true ?
>

There are really two apps running in this case.  First, there is the one
created by JUnitShell, which contacts an RPC servlet to manage running the
test.  The timeout you see is because that servlet didn't get contacted.
 Second, there is your actual test code, which may contact your own servlets
that you create.  Due to SOP, these must be on the same server that the code
was loaded from, but your proxy servlet can run there and redirect the
request to another server since it isn't bound by that restriction.


> In my case, because I run in noserver mode, I run my own tomcat
> standalone server and use a proxy servlet that extends from
> GWTShellServlet to forward any business/servlet calls to my standalone
> server. So I never use any servlet in the GWT tomcat instance and as
> such receive a timeout exception when my tests don't run fast enough,
> which is what sometimes happens....
>

When you say noserver mode, what exactly do you mean?  JUnitShell doesn't
support -noserver, since as mentioned above it's own servlet has to run to
operate the test infrastructure.


> Please feedback on this and how I can solve this ?
> The only option I see now is: disable my GWT test cases as the current
> sometimes-failures is unacceptable on the build machine :(
> I have no idea how to solve it otherwise...


-runStyle Manual was the suggestion for how to debug what is going on.
 There you should be able to see what is going wrong.

If you need a real browser to run the test in an automated way, the
recommendation would be to use -runStyle Selenium:uri and run a Selenium-RC
server with the browser you want to test with.  If you are on Linux, you
can, for example, run Firefox inside an Xvfb instance with a dedicated
profile that includes the Developer Plugin and run your test in DevMode or
compiled to JS.

-- 
John A. Tamplin
Software Engineer (GWT), Google

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to