[ 
https://issues.apache.org/jira/browse/CASSANDRA-16587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17319057#comment-17319057
 ] 

Michael Semb Wever commented on CASSANDRA-16587:
------------------------------------------------

bq. …override BMUnitRunner to incorporate that waiting behaviour by default…

Yeah, this would make sense. Though I think the problem is more than just the 
byteman agent port. For example CASSANDRA-16569 

I am also leaning towards using junit's {{ExternalResource}}, and doing 
something like…
{code}
@ClassRule
public static BytemanAgentDefaultPort globalFolder = new 
BytemanAgentDefaultPort();
{code}
(This approach could go further and reserve the port for us, via tmp file 
locking, making it reliable.)

bq. …build.xml grep and warn for uses of BMUnitRunner…

This could also be done with {{`file contains "@RunWith(BMUnitRunner.class)" 
and not "BytemanAgentDefaultPort"`}}.
Do we do such types of checks anywhere already??

First, we want to make a decision about (1) vs (2). It sounds like you are in 
favour of (2)? I suspect once we start to introduce {{@ClassRule}} is won't 
take long for us to fix the issues… but that said, waiting on and reserving 
fixed ports undermines the test.parallel performance gains, and it is kinda odd 
we're doing this when docker is readily available on the servers we want to be 
performance savvy. (Currently the biggest overhead with the docker approach is 
it 
[build|https://github.com/apache/cassandra-builds/blob/trunk/build-scripts/cassandra-test.sh#L77]
 on a clean container overhead.)

> flaky AntiCompactionBytemanTest.testRedundantTransitions byteman Connection 
> refused
> -----------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-16587
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16587
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: Michael Semb Wever
>            Assignee: Michael Semb Wever
>            Priority: Normal
>             Fix For: 4.0-rc
>
>
> Failing occasionally with 
> {noformat}
> java.net.ConnectException: Connection refused (Connection refused)
>       at java.net.PlainSocketImpl.socketConnect(Native Method)
>       at 
> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
>       at 
> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
>       at 
> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
>       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>       at java.net.Socket.connect(Socket.java:607)
>       at java.net.Socket.connect(Socket.java:556)
>       at java.net.Socket.<init>(Socket.java:452)
>       at java.net.Socket.<init>(Socket.java:229)
>       at org.jboss.byteman.agent.submit.Submit$Comm.<init>(Submit.java:881)
>       at org.jboss.byteman.agent.submit.Submit.submitRequest(Submit.java:787)
>       at org.jboss.byteman.agent.submit.Submit.addScripts(Submit.java:603)
>       at 
> org.jboss.byteman.contrib.bmunit.BMUnit.loadScriptText(BMUnit.java:291)
>       at 
> org.jboss.byteman.contrib.bmunit.BMUnitRunner$9.evaluate(BMUnitRunner.java:362)
>       at 
> org.jboss.byteman.contrib.bmunit.BMUnitRunner$6.evaluate(BMUnitRunner.java:263)
>       at 
> org.jboss.byteman.contrib.bmunit.BMUnitRunner$1.evaluate(BMUnitRunner.java:97)
> {noformat}
> Looking through the [logs 
> |https://nightlies.apache.org/cassandra/trunk/Cassandra-trunk-test-cdc/650/Cassandra-trunk-test-cdc/jdk=jdk_11_latest,label=cassandra,split=6/build/test/logs/cdc/TEST-org.apache.cassandra.db.compaction.AntiCompactionBytemanTest.log.xz]
>  this correlates to
> {noformat}
> Setting org.jboss.byteman.allow.config.update=true
>  TransformListener() : unexpected exception opening server socket 
> java.net.BindException: Address already in use (Bind failed)
>  java.net.BindException: Address already in use (Bind failed)
>       at java.net.PlainSocketImpl.socketBind(Native Method)
>       at 
> java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
>       at java.net.ServerSocket.bind(ServerSocket.java:390)
>       at java.net.ServerSocket.bind(ServerSocket.java:344)
>       at 
> org.jboss.byteman.agent.TransformListener.initialize(TransformListener.java:81)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at org.jboss.byteman.agent.Main.premain(Main.java:286)
>       at org.jboss.byteman.agent.Main.agentmain(Main.java:309)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
>       at 
> sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to