Autotest waits infinitely if logs are not properly configured
Framework version: 1.2.3 and 1.2.4RC2
Platform you're using: ubuntu 11.10 64 bits, java oracle 1.6.0_26
Change the application.conf, add the line
Do not create the file "log4j-dev.properties"
run the command
this commands nevers returns the last log line is
INFO: Listening for HTTP on port 9000 (Waiting a first request to start) ...
It seems that as the auto-test read logs to know if the application is started, if the logs are not correctly configured auto-test does not works and does not say why.
Comments and changes to this ticket
(from [ff0916bf7cac61e018b05a78785cb89b8d86fc70]) [#1222] play auto-test waiting for content which gets really written to ... https://github.com/playframework/play/commit/ff0916bf7cac61e018b05a...
The fix committed for this issue will reintroduce this problem/fix:
The problem being that the text "Go to @tests to run the tests" is output before the server is actually ready, so auto-test fails if the server doesn't start up quickly enough.
Bug #943 is an old one which was actually fixed but it's state never was set to "resolved".
And now the fix for this Bug (#1222) reintroduces the problem which was reported in #943.
I think the problem is that this fix here assumes that when "Go to..." is written to the console the play server is up and running, which isn't true.
"Go to..." is written to the console BEFORE play binds the port it is running on. The port is bind in Server.java on line 106. And afterwards the only real guarantee the server is up and running on this port is to look in the log files for the line starting with "Listening for" (lines 111,113,117,119).
My proposal how to fix both issues: In Server.java write something to the console (not to the log file) like "Server is up and running" when the server has bound it's port. And then listen for this line in base.py. So it's guaranteed the server is running and also play would not wait infinitely when no log file exists.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the http://www.playframework.org website.
Source code is hosted on githubCheck out our repository at http://github.com/playframework/play
Contributing, creating a patchPlease read the contributor guide
Reporting Security VulnerabilitiesSince all bug reports are public, please report any security vulnerability directly to guillaume dot bort at gmail dot com.
Creating a bug reportBug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.
Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.
Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.