How to override the port properties when running the JenkinsRule?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to override the port properties when running the JenkinsRule?

Victor Martinez
Hi guys,

I'm running out of ideas. I'm getting some binding errors when running the tests for the jenkins core locally. Probably that's something I can easily fix by setting the port, but I've no clue where I can find those details, even though I already with  mvn -Pdebug  verify -Dport=18080  but it didn't work (as I saw the property in the source code: (https://github.com/jenkinsci/jenkins-test-harness/blob/6d9d823fffcfac02303a4d330e2ddab9553fe9ac/src/main/java/org/jvnet/hudson/test/JenkinsRule.java#L693)

See the below stacktrace for the record:

java.net.BindException: Can't assign requested address

       at sun.nio.ch.Net.bind0(Native Method)

       at sun.nio.ch.Net.bind(Net.java:433)

       at sun.nio.ch.Net.bind(Net.java:425)

       at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)

       at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

       at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)

       at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)

       at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)

       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

       at org.eclipse.jetty.server.Server.doStart(Server.java:431)

       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

       at org.jvnet.hudson.test.JenkinsRule.createWebServer(JenkinsRule.java:693)

       at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:619)

       at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:391)

       at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:544)


Any ideas what's going on and how I can set the port for my running tests?

Thanks

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/58d3a6b2-2ea0-41a3-bd53-2b3058e5b744%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to override the port properties when running the JenkinsRule?

Carlos Sanchez
is it the port or the ip? I've seen that error when it tried to bind to an ip address that did not exist


On Wed, Jan 30, 2019 at 9:10 PM Victor Martinez <[hidden email]> wrote:
Hi guys,

I'm running out of ideas. I'm getting some binding errors when running the tests for the jenkins core locally. Probably that's something I can easily fix by setting the port, but I've no clue where I can find those details, even though I already with  mvn -Pdebug  verify -Dport=18080  but it didn't work (as I saw the property in the source code: (https://github.com/jenkinsci/jenkins-test-harness/blob/6d9d823fffcfac02303a4d330e2ddab9553fe9ac/src/main/java/org/jvnet/hudson/test/JenkinsRule.java#L693)

See the below stacktrace for the record:

java.net.BindException: Can't assign requested address

       at sun.nio.ch.Net.bind0(Native Method)

       at sun.nio.ch.Net.bind(Net.java:433)

       at sun.nio.ch.Net.bind(Net.java:425)

       at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)

       at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

       at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)

       at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)

       at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)

       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

       at org.eclipse.jetty.server.Server.doStart(Server.java:431)

       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

       at org.jvnet.hudson.test.JenkinsRule.createWebServer(JenkinsRule.java:693)

       at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:619)

       at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:391)

       at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:544)


Any ideas what's going on and how I can set the port for my running tests?

Thanks

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/58d3a6b2-2ea0-41a3-bd53-2b3058e5b744%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALHFn6P3s7QR%2Bc8z%2BAMe_mU0snBk47mgKPqgKyJsCeQWs-o-HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to override the port properties when running the JenkinsRule?

Victor Martinez
I see! Then I completely misunderstood the stacktrace when debugging the line ... I need to narrow down what's causing that issue in my local machine. 

Thanks Carlos!

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/092cfae2-1e34-4159-ab2c-7ec332c9b4e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to override the port properties when running the JenkinsRule?

Victor Martinez
Just for the record, an environmental issue in mi end (quite obvious) I basically tweaked my /etc/hosts for some unknown reason and that's where the localhost was wrongly redirected to a wrong IP. Sorry about the spam and thanks Carlos, you really saved my day. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/40c45677-74fc-4996-8424-be1abe1afb27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.