You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Chris Douglas (JIRA)" <ji...@apache.org> on 2009/03/04 08:43:56 UTC
[jira] Commented: (HADOOP-5386) To Probe free ports dynamically for
Unit test to replace fixed ports
[ https://issues.apache.org/jira/browse/HADOOP-5386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678624#action_12678624 ]
Chris Douglas commented on HADOOP-5386:
---------------------------------------
* As part of this patch, would it be possible to cut the test timeout from 3 minutes to 30 seconds at most?
* Ideally, the proxy would start up on a random port instead of writing the config from ant, but OK. Since FindFreePort is used only in the unit tests, it should probably:
** Move under hdfsproxy/test/...
** Write the whole config file instead of using sed in a later ant task
** Pick a random port instead of starting at a fixed port and rolling to find an open one
* {{ant -Dtestcase=TestHdfsProxy test}} fails reliably on my machine:
{noformat}
test:
[echo] Free Ports: startup-54321 / http-54322 / https-54323
[echo] Please take a deep breath while Cargo gets the Tomcat for running the servlet tests...
[cactus] -----------------------------------------------------------------
[cactus] Running tests against Tomcat 5.x @ http://localhost:54322
[cactus] -----------------------------------------------------------------
[cactus] Deploying [/snip/hadoop/build/contrib/hdfsproxy/target/test.war] to \
[/snip/hadoop/build/contrib/hdfsproxy/target/tomcat-config/webapps]...
[cactus] Tomcat 5.x starting...
Server [Apache-Coyote/1.1] started
[cactus] Running org.apache.hadoop.hdfsproxy.TestHdfsProxy
[cactus] Tomcat 5.x started on port [54322]
[cactus] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 14.53 sec
[cactus] Test org.apache.hadoop.hdfsproxy.TestHdfsProxy FAILED
[cactus] Tomcat 5.x is stopping...
[cactus] Tomcat 5.x is stopped
[junitreport] Processing /snip/hadoop/build/contrib/hdfsproxy/target/reports/TESTS-TestSuites.xml \
to /tmp/null1419962142
[junitreport] Loading stylesheet jar:file:/tools/apache-ant-1.7.1/lib/ant-junit.jar!\
/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 408ms
[junitreport] Deleting: /tmp/null1419962142
BUILD FAILED
/snip/hadoop/build.xml:773: The following error occurred while executing this line:
/snip/hadoop/src/contrib/build.xml:48: The following error occurred while executing this line:
/snip/hadoop/src/contrib/hdfsproxy/build.xml:237: Tests failed!
Total time: 41 seconds
{noformat}
* Note that hdfsproxy isn't the last project in test, but the failure stops the build. That should be fixed, either as part of this issue or in another one.
* When {{ant -Dtestcase=FOO test}} is run, this still starts tomcat.
> To Probe free ports dynamically for Unit test to replace fixed ports
> --------------------------------------------------------------------
>
> Key: HADOOP-5386
> URL: https://issues.apache.org/jira/browse/HADOOP-5386
> Project: Hadoop Core
> Issue Type: Bug
> Components: contrib/hdfsproxy
> Affects Versions: 0.21.0
> Reporter: zhiyong zhang
> Assignee: zhiyong zhang
> Fix For: 0.21.0
>
> Attachments: HADOOP-5386.patch
>
>
> Currently hdfsproxy unit test uses Cactus in-container test. It uses three fixed ports. one for tomcat start-up/shut-down, another for tomcat http-port and the third for tomcat https-port.
> If theses ports are already in use, ant build will fail. To fix this, we decided to use a java program to probe the free ports dynamically and update the tomcat conf with these free ports.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.