-
Bug
-
Resolution: Done
-
Major
-
3.2.0.Beta2
-
None
The following change to the setup of RemoteChannelTest shows the problem, there is a delay before the server is installed and the client tries to connect in the meantime.
$git diff diff --git a/src/test/java/org/jboss/remoting3/test/RemoteChannelTest.java b/src/test/java/org/jboss/remoting3/test/RemoteChannelTest.java index 38d6295..3e3509a 100644 --- a/src/test/java/org/jboss/remoting3/test/RemoteChannelTest.java +++ b/src/test/java/org/jboss/remoting3/test/RemoteChannelTest.java @@ -58,27 +58,44 @@ import org.xnio.channels.ConnectedStreamChannel; /** * Test for remote channel communication. - * + * * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a> */ public final class RemoteChannelTest extends ChannelTestBase { protected static Endpoint endpoint; protected static ExecutorService executorService; - private static AcceptingChannel<? extends ConnectedStreamChannel> streamServer; + private static volatile AcceptingChannel<? extends ConnectedStreamChannel> streamServer; private static Registration registration; private Connection connection; private Registration serviceRegistration; @BeforeClass - public static void create() throws IOException { + public static void create() throws IOException, InterruptedException { executorService = new ThreadPoolExecutor(16, 16, 1L, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>()); endpoint = Remoting.createEndpoint("test", executorService, OptionMap.EMPTY); Xnio xnio = Xnio.getInstance(); registration = endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(xnio), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE)); - NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface("remote", NetworkServerProvider.class); - SimpleServerAuthenticationProvider provider = new SimpleServerAuthenticationProvider(); + final NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface("remote", NetworkServerProvider.class); + final SimpleServerAuthenticationProvider provider = new SimpleServerAuthenticationProvider(); provider.addUser("bob", "test", "pass".toCharArray()); - streamServer = networkServerProvider.createServer(new InetSocketAddress("::1", 30123), OptionMap.create(Options.SASL_MECHANISMS, Sequence.of("CRAM-MD5")), p + + Thread t = new Thread(new Runnable() { + + @Override + public void run() { + try { + Thread.sleep(2000); + streamServer = networkServerProvider.createServer(new InetSocketAddress("::1", 30123), OptionMap.create(Options.SASL_MECHANISMS, Sequence.of("CR + } catch (InterruptedException e) { + // AutoGenerated + throw new RuntimeException(e); + } catch (IOException e) { + // AutoGenerated + throw new RuntimeException(e); + } + } + }); + t.start(); } @Before
The full file has been attached.
- blocks
-
AS7-2396 Remove timeout from connect exception and configuration in ManagementClientChannelStrategy.Establishing
- Resolved