Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73127

Jetty 12 test failure in Security3030Test

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      On the prototype branch of Jenkins core, Security3030Test fails with SocketException on Jetty 12. I have temporarily worked around the issue with the following hack:

      diff --git a/test/src/test/java/jenkins/security/Security3030Test.java b/test/src/test/java/jenkins/security/Security3030Test.java
      index e2d1e4bf5b..5a5ef07f85 100644
      --- a/test/src/test/java/jenkins/security/Security3030Test.java
      +++ b/test/src/test/java/jenkins/security/Security3030Test.java
      @@ -39,6 +39,7 @@ import java.io.OutputStream;
       import java.io.OutputStreamWriter;
       import java.io.PrintWriter;
       import java.lang.reflect.Field;
      +import java.net.SocketException;
       import java.net.URL;
       import java.nio.charset.StandardCharsets;
       import java.util.Random;
      @@ -212,7 +213,11 @@ public class Security3030Test {
               ByteArrayOutputStream baos = new ByteArrayOutputStream();
               writeMultipartFormDataBody(baos, boundary, files, other, fileSize);
               request.setRequestBody(baos.toString());
      -        wc.getPage(request);
      +        try {
      +            wc.getPage(request);
      +        } catch (SocketException e) {
      +            // TODO Why is this behavior changing?
      +        }
               return endpoint.getActual();
           }
      

      The root cause of this change in behavior should be understood. It may actually be a desirable Jetty security enhancement. If the behavior is expected, the test should be adapted (at the very least, to assert that this now expected exception actually occurs). If the behavior is unexpected, the bug should be fixed and the test change reverted. Before submitting the PR to the prototype branch to fix this ticket, ensure that mvn clean verify -Dtest=jenkins.security.Security3030Test passes on both Linux and Windows.

            basil Basil Crow
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: