servlet: Update Servlet container test versions (#11212)

Verifies that latest versions of Tomcat/Undertow/Jetty pass
integration tests - I manually verified that all ignored tests still
fail.

Two tests failed in Jetty, it appears that the integration test
anticipates that the server implementation is willing to send larger
trailers than the client SETTINGS frame allows for. Since the server
refuses to send too large of headers/trailers, the client does not
receive the too-large payloads, and doesn't fail with the expected
message. This change was introduced in Jetty 10.0.15/11.0.11. Those
tests are ignored.
This commit is contained in:
Colin Alworth 2024-05-23 11:49:34 -05:00 committed by GitHub
parent db96219be1
commit 6aa063990a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 59 additions and 55 deletions

View File

@ -45,11 +45,11 @@ j2objc-annotations = " com.google.j2objc:j2objc-annotations:2.8"
jakarta-servlet-api = "jakarta.servlet:jakarta.servlet-api:5.0.0"
javax-annotation = "org.apache.tomcat:annotations-api:6.0.53"
javax-servlet-api = "javax.servlet:javax.servlet-api:4.0.1"
jetty-client = "org.eclipse.jetty:jetty-client:10.0.7"
jetty-http2-server = "org.eclipse.jetty.http2:http2-server:11.0.7"
jetty-http2-server10 = "org.eclipse.jetty.http2:http2-server:10.0.7"
jetty-servlet = "org.eclipse.jetty:jetty-servlet:11.0.7"
jetty-servlet10 = "org.eclipse.jetty:jetty-servlet:10.0.7"
jetty-client = "org.eclipse.jetty:jetty-client:10.0.20"
jetty-http2-server = "org.eclipse.jetty.http2:http2-server:11.0.20"
jetty-http2-server10 = "org.eclipse.jetty.http2:http2-server:10.0.20"
jetty-servlet = "org.eclipse.jetty:jetty-servlet:11.0.20"
jetty-servlet10 = "org.eclipse.jetty:jetty-servlet:10.0.20"
jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
junit = "junit:junit:4.13.2"
lincheck = "org.jetbrains.kotlinx:lincheck:2.14.1"
@ -87,11 +87,11 @@ re2j = "com.google.re2j:re2j:1.7"
robolectric = "org.robolectric:robolectric:4.11.1"
signature-android = "net.sf.androidscents.signature:android-api-level-19:4.4.2_r4"
signature-java = "org.codehaus.mojo.signature:java18:1.0"
tomcat-embed-core = "org.apache.tomcat.embed:tomcat-embed-core:10.0.14"
tomcat-embed-core9 = "org.apache.tomcat.embed:tomcat-embed-core:9.0.56"
tomcat-embed-core = "org.apache.tomcat.embed:tomcat-embed-core:10.1.23"
tomcat-embed-core9 = "org.apache.tomcat.embed:tomcat-embed-core:9.0.89"
truth = "com.google.truth:truth:1.1.5"
undertow-servlet = "io.undertow:undertow-servlet:2.2.14.Final"
undertow-servlet-jakartaee9 = "io.undertow:undertow-servlet-jakartaee9:2.2.13.Final"
undertow-servlet = "io.undertow:undertow-servlet:2.2.32.Final"
undertow-servlet-jakartaee9 = "io.undertow:undertow-servlet:2.3.13.Final"
# Do not update: Pinned to the last version supporting Java 8.
# See https://checkstyle.sourceforge.io/releasenotes.html#Release_10.1

View File

@ -37,15 +37,14 @@ dependencies {
compileOnly libraries.javax.servlet.api,
libraries.javax.annotation // java 9, 10 needs it
implementation project(':grpc-util'),
project(':grpc-core'),
implementation project(':grpc-core'),
libraries.guava
testImplementation libraries.javax.servlet.api
threadingTestImplementation project(':grpc-servlet'),
libraries.truth,
libraries.javax.servlet.api,
libraries.javax.servlet.api,
libraries.lincheck
itImplementation project(':grpc-servlet'),

View File

@ -7,16 +7,7 @@ description = "gRPC: Jakarta Servlet"
// Set up classpaths and source directories for different servlet tests
sourceSets {
undertowTest {
java {
include '**/Undertow*.java'
}
}
tomcatTest {
java {
include '**/Tomcat*.java'
}
}
// Only run these tests if java 11+ is being used
if (JavaVersion.current().isJava11Compatible()) {
jettyTest {
@ -24,6 +15,16 @@ sourceSets {
include '**/Jetty*.java'
}
}
tomcatTest {
java {
include '**/Tomcat*.java'
}
}
undertowTest {
java {
include '**/Undertow*.java'
}
}
}
}
@ -56,12 +57,11 @@ def migrate(String name, String inputDir, SourceSet sourceSet) {
migrate('main', '../src/main/java', sourceSets.main)
// Build the set of sourceSets and classpaths to modify, since Jetty 11 requires Java 11
// and must be skipped
migrate('undertowTest', '../src/undertowTest/java', sourceSets.undertowTest)
migrate('tomcatTest', '../src/tomcatTest/java', sourceSets.tomcatTest)
// Only build sourceSets and classpaths for tests if using Java 11
if (JavaVersion.current().isJava11Compatible()) {
migrate('jettyTest', '../src/jettyTest/java', sourceSets.jettyTest)
migrate('tomcatTest', '../src/tomcatTest/java', sourceSets.tomcatTest)
migrate('undertowTest', '../src/undertowTest/java', sourceSets.undertowTest)
}
// Disable checkstyle for this project, since it consists only of generated code
@ -104,41 +104,36 @@ dependencies {
// Set up individual classpaths for each test, to avoid any mismatch,
// and ensure they are only used when supported by the current jvm
def undertowTest = tasks.register('undertowTest', Test) {
classpath = sourceSets.undertowTest.runtimeClasspath
testClassesDirs = sourceSets.undertowTest.output.classesDirs
}
def tomcat10Test = tasks.register('tomcat10Test', Test) {
classpath = sourceSets.tomcatTest.runtimeClasspath
testClassesDirs = sourceSets.tomcatTest.output.classesDirs
// Provide a temporary directory for tomcat to be deleted after test finishes
def tomcatTempDir = "$buildDir/tomcat_catalina_base"
systemProperty 'catalina.base', tomcatTempDir
doLast {
file(tomcatTempDir).deleteDir()
}
// tomcat-embed-core 10 presently performs illegal reflective access on
// java.io.ObjectStreamClass$Caches.localDescs and sun.rmi.transport.Target.ccl,
// see https://lists.apache.org/thread/s0xr7tk2kfkkxfjps9n7dhh4cypfdhyy
if (JavaVersion.current().isJava9Compatible()) {
jvmArgs += ['--add-opens=java.base/java.io=ALL-UNNAMED', '--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED']
}
}
tasks.named("check").configure {
dependsOn undertowTest, tomcat10Test
}
// Only run these tests if java 11+ is being used
if (JavaVersion.current().isJava11Compatible()) {
def jetty11Test = tasks.register('jetty11Test', Test) {
classpath = sourceSets.jettyTest.runtimeClasspath
testClassesDirs = sourceSets.jettyTest.output.classesDirs
}
def tomcat10Test = tasks.register('tomcat10Test', Test) {
classpath = sourceSets.tomcatTest.runtimeClasspath
testClassesDirs = sourceSets.tomcatTest.output.classesDirs
// Provide a temporary directory for tomcat to be deleted after test finishes
def tomcatTempDir = "$buildDir/tomcat_catalina_base"
systemProperty 'catalina.base', tomcatTempDir
doLast {
file(tomcatTempDir).deleteDir()
}
}
tasks.named('compileTomcatTestJava') { JavaCompile task ->
task.options.release.set 11
}
def undertowTest = tasks.register('undertowTest', Test) {
classpath = sourceSets.undertowTest.runtimeClasspath
testClassesDirs = sourceSets.undertowTest.output.classesDirs
}
tasks.named('compileUndertowTestJava') { JavaCompile task ->
task.options.release.set 11
}
tasks.named("check").configure {
dependsOn jetty11Test
dependsOn jetty11Test, tomcat10Test, undertowTest
}
}

View File

@ -252,4 +252,14 @@ public class JettyTransportTest extends AbstractTransportTest {
@Ignore("regression since bumping grpc v1.46 to v1.53")
@Test
public void messageProducerOnlyProducesRequestedMessages() {}
@Override
@Ignore("https://github.com/jetty/jetty.project/issues/11822")
@Test
public void clientChecksInboundMetadataSize_header() {}
@Override
@Ignore("https://github.com/jetty/jetty.project/issues/11822")
@Test
public void clientChecksInboundMetadataSize_trailer() {}
}