Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managing test flakes #637

Merged
merged 1 commit into from Jun 7, 2023
Merged

Managing test flakes #637

merged 1 commit into from Jun 7, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented May 8, 2023

Some failures observed in CI, but mainly just running

mvn test -DforkCount=.45C

(about five concurrent tests on my machine) over and over. Surprisingly hard to get a clean run; #142 masks poor tests and we do not yet have the infrastructure to track flakes (maybe Launchable could).

@jglick jglick requested a review from Vlatombe May 8, 2023 19:02
@jglick jglick added the test label May 8, 2023
@jglick jglick requested a review from a team May 8, 2023 19:03
@@ -200,6 +201,7 @@ public void testContinuedInterruptionOfClassReferenceCreation(ChannelRunner chan
});
}

@Disabled("TODO first call consistently flakes: Remote call on north failed")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -50,6 +51,7 @@ public class ClassRemotingTest {
static final String TESTCALLABLE_TRANSFORMED_CLASSNAME = "hudson.rem0ting.TestCallable";
static final String TESTLINKAGE_TRANSFORMED_CLASSNAME = "hudson.rem0ting.TestLinkage";

@Disabled("TODO flakes: Artificial testing interrupt.")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is going on with these. Interference from

throw new InterruptedException("Artificial testing interrupt.");
(in a different source!) suggests something structurally wrong with the tests.

@@ -36,7 +35,6 @@
/**
* @author Kohsuke Kawaguchi
*/
@Ignore
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabled in #387, yet consistently passing for me, and this annotation does not even work since #593, so trying to run it again. Whatever it is that it is testing; from

// TODO: how can I do a meaningful test of this feature?
System.out.println(channel.call(vt));
that may be nothing and maybe it should simply be deleted.


@Ignore("This is not a test just a benchmark and is here for ease of running")
@Disabled("This is not a test just a benchmark and is here for ease of running")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again #593

@@ -114,7 +116,7 @@ public void ready(boolean accept, boolean connect, boolean read, boolean write)
} catch (IOException e) {
// ignore
}
hub.hub().addInterestAccept(key.get());
h.addInterestAccept(key.get());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to make sure the same hub is being used.

@@ -203,14 +205,16 @@ public void onClosedChannel(ClosedChannelException e) {
}
}

@Disabled("TODO flakes: Read timed out; or expected java.net.SocketTimeoutException to be thrown, but nothing was thrown")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging by 247f15b this test is just inherently flaky.

java.net.SocketTimeoutException: Read timed out
	at java.base/java.net.SocketInputStream.socketRead0(Native Method)
	at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
	at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181)
	at java.base/java.io.Reader.read(Reader.java:229)
	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1432)
	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1411)
	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1208)
	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1022)
	at org.apache.commons.io.IOUtils.toString(IOUtils.java:2839)
	at org.jenkinsci.remoting.protocol.IOHubTest.noReadyCallbackIfInterestRemoved(IOHubTest.java:256)

or

java.lang.AssertionError: expected java.net.SocketTimeoutException to be thrown, but nothing was thrown
	at org.junit.Assert.assertThrows(Assert.java:1028)
	at org.junit.Assert.assertThrows(Assert.java:981)
	at org.jenkinsci.remoting.protocol.IOHubTest.noReadyCallbackIfInterestRemoved(IOHubTest.java:267)

@@ -447,7 +448,6 @@ public void socketBasicBackToBackWithAckSSLEngineHeaders() throws Exception {
}

@Test
@Repeat(16)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise can get timeouts. Anyway, why did we need to run these 16 times to “prove” that the code was correct?

@@ -750,6 +747,7 @@ public void socketChannelFullProtocolNIO_serverRejects() throws Exception {
assertThat(se.getCause(), instanceOf(ConnectionRefusalException.class));
}

@Disabled("TODO flake: ConnectionRefusal Incorrect acknowledgement received, expected 0x000341436b got 0x0000000000")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception is expected, but sometimes gets thrown too early (in release). Not sure what test should be doing.

@jglick jglick merged commit bb67e86 into jenkinsci:master Jun 7, 2023
13 checks passed
@jglick jglick deleted the flakes branch June 7, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants