error of 'buck test -all'

96 views
Skip to first unread message

Bruce Zu

unread,
Jul 29, 2013, 10:12:27 PM7/29/13
to repo-d...@googlegroups.com
$ git describe
v2.7-rc3-985-g28e4884

$ buck test --all
[cut]
com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused
[cut]
Caused by: java.net.ConnectException: Connection refused
[cut]
TESTS FAILED: 44 Failures

Shawn Pearce

unread,
Jul 29, 2013, 10:19:24 PM7/29/13
to Bruce Zu, repo-discuss
Looks like the port numbers got confused? Can you see which test and
what port it was on and go look at the corresponding gerrit.config
file for that test and see if the port number was parsed correctly?

Bruce Zu

unread,
Jul 29, 2013, 11:24:00 PM7/29/13
to repo-d...@googlegroups.com, Bruce Zu

I can see the port by adding one line
 System.out.println(" in getSession()  is using port: " + port); 
here

private Session getSession() throws JSchException {
    if (session == null) {
      JSch jsch = new JSch();
      jsch.addIdentity("KeyPair",
          account.privateKey(), account.sshKey.getPublicKeyBlob(), null);
      session = jsch.getSession(account.username, "localhost", port);
      System.out.println(" in getSession()  is using port: " + port);
      session.setConfig("StrictHostKeyChecking", "no");
      session.connect();
    }
    return session;
  }

but how  where to find the 'corresponding gerrit.config file'

try to debug and find in eclipse to run any acceptance test  *IT.java will run into  "throw new FileNotFoundException(NOT_ARCHIVED);"



Bruce Zu

unread,
Jul 29, 2013, 11:26:33 PM7/29/13
to repo-d...@googlegroups.com, Bruce Zu
all the com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused
are comes from
    at com.jcraft.jsch.Util.createSocket(Util.java:341)
    at com.jcraft.jsch.Session.connect(Session.java:186)
    at com.jcraft.jsch.Session.connect(Session.java:154)
    at com.google.gerrit.acceptance.SshSession.getSession(SshSession.java:81)
    at com.google.gerrit.acceptance.SshSession.exec(SshSession.java:40)
    at com.google.gerrit.acceptance.git.GitUtil.createProject(GitUtil.java:102)
    at com.google.gerrit.acceptance.git.GitUtil.createProject(GitUtil.java:83)
    at com.google.gerrit.acceptance.git.GitUtil.createProject(GitUtil.java:78)

Zu, Bruce

unread,
Jul 29, 2013, 11:30:25 PM7/29/13
to Shawn Pearce, repo-discuss

Aha I know where to ' go look at the corresponding gerrit.config ' now.

Zu, Bruce

unread,
Jul 29, 2013, 11:39:10 PM7/29/13
to Shawn Pearce, repo-discuss
> what port it was on:

====STANDARD OUT====
Gerrit Server Started
in getSession() of com.google.gerrit.acceptance.SshSession is using port: 47870
Gerrit Server Shutdown

====STANDARD ERR====
Generating SSH host key ... rsa(simple)... done
Initialized /home/CORPUSERS/28850272/gerrit-code/google-gerrit/gerrit/buck-out/gen/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project/__java_test_ListBranchesIT_tmp__/gerrit_test_6908395463405313260

FAILURE listBranchesOfNonVisibleProject_NotFound: java.net.ConnectException: Connection refused
com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused
at com.jcraft.jsch.Util.createSocket(Util.java:341)
at com.jcraft.jsch.Session.connect(Session.java:186)
at com.jcraft.jsch.Session.connect(Session.java:154)
at com.google.gerrit.acceptance.SshSession.getSession(SshSession.java:81)
at com.google.gerrit.acceptance.SshSession.exec(SshSession.java:40)
at com.google.gerrit.acceptance.git.GitUtil.createProject(GitUtil.java:102)
at com.google.gerrit.acceptance.git.GitUtil.createProject(GitUtil.java:83)
at com.google.gerrit.acceptance.git.GitUtil.createProject(GitUtil.java:78)
at com.google.gerrit.acceptance.rest.project.ListBranchesIT.setUp(ListBranchesIT.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at com.facebook.buck.junit.BuckBlockJUnit4ClassRunner.runTest(BuckBlockJUnit4ClassRunner.java:88)
at com.facebook.buck.junit.JUnitRunner$1.call(JUnitRunner.java:109)
at com.facebook.buck.junit.JUnitRunner$1.call(JUnitRunner.java:106)
at com.facebook.buck.junit.TestResult.runTestMethod(TestResult.java:80)
at com.facebook.buck.junit.JUnitRunner.run(JUnitRunner.java:122)
at com.facebook.buck.junit.JUnitRunner.main(JUnitRunner.java:284)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at com.jcraft.jsch.Util.createSocket(Util.java:335)
... 32 more

------------
> corresponding gerrit.config file:

28850272@cnbjlx6200:~/gerrit-code/google-gerrit/gerrit/buck-out/gen/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project/__java_test_ListBranchesIT_tmp__/gerrit_test_6908395463405313260/etc$ cat gerrit.config
[gerrit]
basePath = git
canonicalWebUrl = http://127.0.1.1:50477/
[database]
type = h2
database = db/ReviewDB
[auth]
type = OPENID
[sendemail]
smtpServer = localhost
[container]
user = 28850272
javaHome = /usr/lib/jvm/jdk1.7.0/jre
[sshd]
listenAddress = 127.0.1.1:47870
[httpd]
listenUrl = http://127.0.1.1:50477/
[cache]
directory = cache


-----Original Message-----
From: Shawn Pearce [mailto:s...@google.com]
Sent: Tuesday, July 30, 2013 10:19 AM
To: Zu, Bruce
Cc: repo-discuss
Subject: Re: error of 'buck test -all'

Shawn Pearce

unread,
Jul 30, 2013, 12:02:41 AM7/30/13
to Zu, Bruce, repo-discuss
On Mon, Jul 29, 2013 at 8:39 PM, Zu, Bruce <Bruc...@sonymobile.com> wrote:
>> what port it was on:
>
> ====STANDARD OUT====
> Gerrit Server Started
> in getSession() of com.google.gerrit.acceptance.SshSession is using port: 47870
> Gerrit Server Shutdown
...
> [sshd]
> listenAddress = 127.0.1.1:47870
> [httpd]
> listenUrl = http://127.0.1.1:50477/

The client connects to 128.0.0.1 but the address lines were written
for 128.0.1.1. WTF? Looks like we are confused about the definition of
"localhost" on this system.

Zu, Bruce

unread,
Jul 30, 2013, 12:14:46 AM7/30/13
to Shawn Pearce, repo-discuss
I think so just test and try to fix it :)

-----Original Message-----
From: repo-d...@googlegroups.com [mailto:repo-d...@googlegroups.com] On Behalf Of Shawn Pearce
Sent: Tuesday, July 30, 2013 12:03 PM
To: Zu, Bruce
Cc: repo-discuss
Subject: Re: error of 'buck test -all'

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Bruce Zu

unread,
Jul 30, 2013, 1:21:15 AM7/30/13
to repo-d...@googlegroups.com, Shawn Pearce

Hi Shawn;

Thanks a lot!  the issue is fixed by your:

96ee63a Add fallbacks for detecting localhost
7847c59 Use resolved address rather than "localhost" in acceptance tests
a572c1a Rename DEFS files to *.defs
1b5e635 Move download and download_sources to //tools
8442ed9 Move Maven support to //tools/maven


/Bruce

 


On Tuesday, July 30, 2013 12:14:46 PM UTC+8, Bruce Zu wrote:
I think so just test and try to fix it :)

-----Original Message-----
From: repo-d...@googlegroups.com [mailto:repo-discuss@googlegroups.com] On Behalf Of Shawn Pearce
Sent: Tuesday, July 30, 2013 12:03 PM
To: Zu, Bruce
Cc: repo-discuss
Subject: Re: error of 'buck test -all'

On Mon, Jul 29, 2013 at 8:39 PM, Zu, Bruce <Bruc...@sonymobile.com> wrote:
>> what port it was on:
>
> ====STANDARD OUT====
> Gerrit Server Started
>  in getSession() of com.google.gerrit.acceptance.SshSession is using
> port: 47870 Gerrit Server Shutdown
...
> [sshd]
>         listenAddress = 127.0.1.1:47870 [httpd]
>         listenUrl = http://127.0.1.1:50477/

The client connects to 128.0.0.1 but the address lines were written for 128.0.1.1. WTF? Looks like we are confused about the definition of "localhost" on this system.

--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages