[testng-dev] testng master/slave second slave always throws EOFException

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

[testng-dev] testng master/slave second slave always throws EOFException

Mike Cavedon
I am using testng master/slave. The first slave kicks off the test correctly. The second test always fails with an EOFException. The "Address already in use" occurs when the second slave tries to recreate the connection.

My master has:

org.testng.TestNG -master ../testng/hosts.propertiest testng1.xml testng2.xml

My second slave always fails with:

jenkins@host-1:~/workspace/realtime-system-integration:(master)$ ./testng-slave.sh 
*** SLAVE_PORT is 5151
java.lang.Exception
at org.testng.remote.adapter.DefaultWorkerAdapter.getSuite(DefaultWorkerAdapter.java:51)
at org.testng.remote.SuiteSlave.waitForSuites(SuiteSlave.java:82)
at org.testng.TestNG.run(TestNG.java:1050)
at org.testng.TestNG.privateMain(TestNG.java:1364)
at org.testng.TestNG.main(TestNG.java:1333)
*** ex is java.io.EOFException
java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:106)
at org.testng.remote.adapter.DefaultWorkerAdapter.resetSocket(DefaultWorkerAdapter.java:83)
at org.testng.remote.adapter.DefaultWorkerAdapter.getSuite(DefaultWorkerAdapter.java:57)
at org.testng.remote.SuiteSlave.waitForSuites(SuiteSlave.java:82)
at org.testng.TestNG.run(TestNG.java:1050)
at org.testng.TestNG.privateMain(TestNG.java:1364)
at org.testng.TestNG.main(TestNG.java:1333)

Any ideas?

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

[testng-dev] Re: testng master/slave second slave always throws EOFException

Mike Cavedon
I made the following changes to testng to get master/slave to work. How do I create a pull request?

$ git diff
diff --git a/src/main/java/org/testng/collections/ListMultiMap.java b/src/main/java/org/testng/collections/ListMultiMap.java
index 71b5cdc..de124cb 100644
--- a/src/main/java/org/testng/collections/ListMultiMap.java
+++ b/src/main/java/org/testng/collections/ListMultiMap.java
@@ -1,6 +1,7 @@
 package org.testng.collections;
 
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -11,7 +12,7 @@ import java.util.Set;
 /**
  * A container to hold lists indexed by a key.
  */
-public class ListMultiMap<K, V> {
+public class ListMultiMap<K, V> implements Serializable {
   private Map<K, List<V>> m_objects = Maps.newHashMap();
 
   public void put(K key, V method) {
diff --git a/src/main/java/org/testng/internal/BshMock.java b/src/main/java/org/testng/internal/BshMock.java
index 840bf6c..2a908b1 100644
--- a/src/main/java/org/testng/internal/BshMock.java
+++ b/src/main/java/org/testng/internal/BshMock.java
@@ -1,8 +1,10 @@
 package org.testng.internal;
 
+import java.io.Serializable;
+
 import org.testng.ITestNGMethod;
 
-public class BshMock implements IBsh {
+public class BshMock implements IBsh, Serializable {
 
   @Override
   public boolean includeMethodFromExpression(String expression, ITestNGMethod tm) {
diff --git a/src/main/java/org/testng/remote/adapter/DefaultMastertAdapter.java b/src/main/java/org/testng/remote/adapter/DefaultMastertAdapter.java
index fcc5c5c..76247d6 100755
--- a/src/main/java/org/testng/remote/adapter/DefaultMastertAdapter.java
+++ b/src/main/java/org/testng/remote/adapter/DefaultMastertAdapter.java
@@ -83,6 +83,6 @@ implements IMasterAdapter
        @Override
   public void awaitTermination(long timeout) throws InterruptedException
        {
-               ThreadUtil.execute(m_workers, 1, 10 * 1000L, false);
+               ThreadUtil.execute(m_workers, m_workers.size(), 10 * 1000L, false);
        }
 }

Thanks.

On Friday, February 14, 2014 8:05:27 PM UTC-5, Mike Cavedon wrote:
I am using testng master/slave. The first slave kicks off the test correctly. The second test always fails with an EOFException. The "Address already in use" occurs when the second slave tries to recreate the connection.

My master has:

org.testng.TestNG -master ../testng/hosts.propertiest testng1.xml testng2.xml

My second slave always fails with:

jenkins@host-1:~/workspace/realtime-system-integration:(master)$ ./testng-slave.sh 
*** SLAVE_PORT is 5151
java.lang.Exception
at org.testng.remote.adapter.DefaultWorkerAdapter.getSuite(DefaultWorkerAdapter.java:51)
at org.testng.remote.SuiteSlave.waitForSuites(SuiteSlave.java:82)
at org.testng.TestNG.run(TestNG.java:1050)
at org.testng.TestNG.privateMain(TestNG.java:1364)
at org.testng.TestNG.main(TestNG.java:1333)
*** ex is java.io.EOFException
java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:106)
at org.testng.remote.adapter.DefaultWorkerAdapter.resetSocket(DefaultWorkerAdapter.java:83)
at org.testng.remote.adapter.DefaultWorkerAdapter.getSuite(DefaultWorkerAdapter.java:57)
at org.testng.remote.SuiteSlave.waitForSuites(SuiteSlave.java:82)
at org.testng.TestNG.run(TestNG.java:1050)
at org.testng.TestNG.privateMain(TestNG.java:1364)
at org.testng.TestNG.main(TestNG.java:1333)

Any ideas?

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/groups/opt_out.