[JAVA-28845] Fix testing-modules/gatling in the context of migration to JDK 21 (#16487)
This commit is contained in:
parent
db34c4b3c3
commit
611d68f41e
@ -33,7 +33,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.scala-lang</groupId>
|
<groupId>org.scala-lang</groupId>
|
||||||
<artifactId>scala-library</artifactId>
|
<artifactId>scala3-library_3</artifactId>
|
||||||
<version>${scala.version}</version>
|
<version>${scala.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.scala-lang</groupId>
|
<groupId>org.scala-lang</groupId>
|
||||||
<artifactId>scala-library</artifactId>
|
<artifactId>scala3-library_3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@ -105,10 +105,10 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<scala.version>2.12.6</scala.version>
|
<scala.version>3.4.1</scala.version>
|
||||||
<gatling.version>3.3.1</gatling.version>
|
<gatling.version>3.10.5</gatling.version>
|
||||||
<scala-maven-plugin.version>4.3.0</scala-maven-plugin.version>
|
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
|
||||||
<gatling-maven-plugin.version>3.0.4</gatling-maven-plugin.version>
|
<gatling-maven-plugin.version>4.8.1</gatling-maven-plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -6,15 +6,13 @@
|
|||||||
|
|
||||||
gatling {
|
gatling {
|
||||||
core {
|
core {
|
||||||
#outputDirectoryBaseName = "" # The prefix for each simulation result folder (then suffixed by the report generation timestamp)
|
|
||||||
#runDescription = "" # The description for this simulation run, displayed in each report
|
|
||||||
#encoding = "utf-8" # Encoding to use throughout Gatling for file and string manipulation
|
#encoding = "utf-8" # Encoding to use throughout Gatling for file and string manipulation
|
||||||
#simulationClass = "" # The FQCN of the simulation to run (when used in conjunction with noReports, the simulation for which assertions will be validated)
|
|
||||||
#mute = false # When set to true, don't ask for simulation name nor run description (currently only used by Gatling SBT plugin)
|
|
||||||
#elFileBodiesCacheMaxCapacity = 200 # Cache size for request body EL templates, set to 0 to disable
|
#elFileBodiesCacheMaxCapacity = 200 # Cache size for request body EL templates, set to 0 to disable
|
||||||
#rawFileBodiesCacheMaxCapacity = 200 # Cache size for request body Raw templates, set to 0 to disable
|
#rawFileBodiesCacheMaxCapacity = 200 # Cache size for request body raw files, set to 0 to disable
|
||||||
#rawFileBodiesInMemoryMaxSize = 1000 # Below this limit, raw file bodies will be cached in memory
|
#rawFileBodiesInMemoryMaxSize = 10240 # Max bite size of raw files to be cached in memory
|
||||||
|
#pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Pebble templates, set to 0 to disable
|
||||||
|
#feederAdaptiveLoadModeThreshold = 100 # File size threshold (in MB). Below load eagerly in memory, above use batch mode with default buffer size
|
||||||
|
#shutdownTimeout = 10000 # Milliseconds to wait for the actor system to shutdown
|
||||||
extract {
|
extract {
|
||||||
regex {
|
regex {
|
||||||
#cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching
|
#cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching
|
||||||
@ -24,20 +22,45 @@ gatling {
|
|||||||
}
|
}
|
||||||
jsonPath {
|
jsonPath {
|
||||||
#cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching
|
#cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching
|
||||||
#preferJackson = false # When set to true, prefer Jackson over Boon for JSON-related operations
|
|
||||||
}
|
}
|
||||||
css {
|
css {
|
||||||
#cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries, set to 0 to disable caching
|
#cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries, set to 0 to disable caching
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
directory {
|
socket {
|
||||||
#data = user-files/data # Folder where user's data (e.g. files used by Feeders) is located
|
#connectTimeout = 10000 # Timeout in millis for establishing a TCP socket
|
||||||
#bodies = user-files/bodies # Folder where bodies are located
|
#tcpNoDelay = true
|
||||||
#simulations = user-files/simulations # Folder where the bundle's simulations are located
|
#soKeepAlive = false # if TCP keepalive configured at OS level should be used
|
||||||
#reportsOnly = "" # If set, name of report folder to look for in order to generate its report
|
#soReuseAddress = false
|
||||||
#binaries = "" # If set, name of the folder where compiles classes are located: Defaults to GATLING_HOME/target.
|
}
|
||||||
#results = results # Name of the folder where all reports folder are located
|
netty {
|
||||||
|
#useNativeTransport = true # if Netty Linux native transport should be used instead of Java NIO
|
||||||
|
#useIoUring = false # if io_uring should be used instead of epoll if available
|
||||||
|
#allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator
|
||||||
|
#maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k
|
||||||
|
}
|
||||||
|
ssl {
|
||||||
|
#useOpenSsl = true # if OpenSSL should be used instead of JSSE (only the latter can be debugged with -Djavax.net.debug=ssl)
|
||||||
|
#useOpenSslFinalizers = false # if OpenSSL contexts should be freed with Finalizer or if using RefCounted is fine
|
||||||
|
#handshakeTimeout = 10000 # TLS handshake timeout in millis
|
||||||
|
#useInsecureTrustManager = true # Use an insecure TrustManager that trusts all server certificates
|
||||||
|
#enabledProtocols = [] # Array of enabled protocols for HTTPS, if empty use Netty's defaults
|
||||||
|
#enabledCipherSuites = [] # Array of enabled cipher suites for HTTPS, if empty enable all available ciphers
|
||||||
|
#sessionCacheSize = 0 # SSLSession cache size, set to 0 to use JDK's default
|
||||||
|
#sessionTimeout = 0 # SSLSession timeout in seconds, set to 0 to use JDK's default (24h)
|
||||||
|
#enableSni = true # When set to true, enable Server Name indication (SNI)
|
||||||
|
keyStore {
|
||||||
|
#type = "" # Type of SSLContext's KeyManagers store, possible values are jks and p12
|
||||||
|
#file = "" # Location of SSLContext's KeyManagers store
|
||||||
|
#password = "" # Password for SSLContext's KeyManagers store
|
||||||
|
#algorithm = "" # Algorithm used SSLContext's KeyManagers store, typically RSA
|
||||||
|
}
|
||||||
|
trustStore {
|
||||||
|
#type = "" # Type of SSLContext's TrustManagers store, possible values are jks and p12
|
||||||
|
#file = "" # Location of SSLContext's TrustManagers store
|
||||||
|
#password = "" # Password for SSLContext's TrustManagers store
|
||||||
|
#algorithm = "" # Algorithm used by SSLContext's TrustManagers store, typically RSA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
charting {
|
charting {
|
||||||
@ -57,56 +80,24 @@ gatling {
|
|||||||
#fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable
|
#fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable
|
||||||
#fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable
|
#fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable
|
||||||
#perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable
|
#perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable
|
||||||
#warmUpUrl = "http://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled)
|
#warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled)
|
||||||
#enableGA = true # Very light Google Analytics, please support
|
#pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool
|
||||||
ssl {
|
#requestTimeout = 60000 # Timeout in millis for performing an HTTP request
|
||||||
keyStore {
|
#enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS")
|
||||||
#type = "" # Type of SSLContext's KeyManagers store
|
|
||||||
#file = "" # Location of SSLContext's KeyManagers store
|
|
||||||
#password = "" # Password for SSLContext's KeyManagers store
|
|
||||||
#algorithm = "" # Algorithm used SSLContext's KeyManagers store
|
|
||||||
}
|
|
||||||
trustStore {
|
|
||||||
#type = "" # Type of SSLContext's TrustManagers store
|
|
||||||
#file = "" # Location of SSLContext's TrustManagers store
|
|
||||||
#password = "" # Password for SSLContext's TrustManagers store
|
|
||||||
#algorithm = "" # Algorithm used by SSLContext's TrustManagers store
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ahc {
|
|
||||||
#keepAlive = true # Allow pooling HTTP connections (keep-alive header automatically added)
|
|
||||||
#connectTimeout = 60000 # Timeout when establishing a connection
|
|
||||||
#pooledConnectionIdleTimeout = 60000 # Timeout when a connection stays unused in the pool
|
|
||||||
#readTimeout = 60000 # Timeout when a used connection stays idle
|
|
||||||
#maxRetry = 2 # Number of times that a request should be tried again
|
|
||||||
#requestTimeout = 60000 # Timeout of the requests
|
|
||||||
#acceptAnyCertificate = true # When set to true, doesn't validate SSL certificates
|
|
||||||
#httpClientCodecMaxInitialLineLength = 4096 # Maximum length of the initial line of the response (e.g. "HTTP/1.0 200 OK")
|
|
||||||
#httpClientCodecMaxHeaderSize = 8192 # Maximum size, in bytes, of each request's headers
|
|
||||||
#httpClientCodecMaxChunkSize = 8192 # Maximum length of the content or each chunk
|
|
||||||
#webSocketMaxFrameSize = 10240000 # Maximum frame payload size
|
|
||||||
#sslEnabledProtocols = [TLSv1.2, TLSv1.1, TLSv1] # Array of enabled protocols for HTTPS, if empty use the JDK defaults
|
|
||||||
#sslEnabledCipherSuites = [] # Array of enabled cipher suites for HTTPS, if empty use the JDK defaults
|
|
||||||
#sslSessionCacheSize = 0 # SSLSession cache size, set to 0 to use JDK's default
|
|
||||||
#sslSessionTimeout = 0 # SSLSession timeout in seconds, set to 0 to use JDK's default (24h)
|
|
||||||
#useOpenSsl = false # if OpenSSL should be used instead of JSSE (requires tcnative jar)
|
|
||||||
#useNativeTransport = false # if native transport should be used instead of Java NIO (requires netty-transport-native-epoll, currently Linux only)
|
|
||||||
#usePooledMemory = true # if Gatling should use pooled memory
|
|
||||||
#tcpNoDelay = true
|
|
||||||
#soReuseAddress = false
|
|
||||||
#soLinger = -1
|
|
||||||
#soSndBuf = -1
|
|
||||||
#soRcvBuf = -1
|
|
||||||
}
|
|
||||||
dns {
|
dns {
|
||||||
#queryTimeout = 5000 # Timeout of each DNS query in millis
|
#queryTimeout = 5000 # Timeout in millis of each DNS query in millis
|
||||||
#maxQueriesPerResolve = 3 # Maximum allowed number of DNS queries for a given name resolution
|
#maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
jms {
|
||||||
|
#replyTimeoutScanPeriod = 1000 # scan period for timed out reply messages
|
||||||
|
}
|
||||||
data {
|
data {
|
||||||
#writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite, jdbc)
|
#writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite)
|
||||||
|
#utcDateTime = true # Print date-times with the UTC zone instead of the System's default
|
||||||
console {
|
console {
|
||||||
#light = false # When set to true, displays a light version without detailed request stats
|
#light = false # When set to true, displays a light version without detailed request stats
|
||||||
|
#writePeriod = 5 # Write interval, in seconds
|
||||||
}
|
}
|
||||||
file {
|
file {
|
||||||
#bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes
|
#bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes
|
||||||
@ -120,8 +111,9 @@ gatling {
|
|||||||
#port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
|
#port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
|
||||||
#protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
|
#protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
|
||||||
#rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
|
#rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
|
||||||
#bufferSize = 8192 # GraphiteDataWriter's internal data buffer size, in bytes
|
#bufferSize = 8192 # Internal data buffer size, in bytes
|
||||||
#writeInterval = 1 # GraphiteDataWriter's write interval, in seconds
|
#writePeriod = 1 # Write period, in seconds
|
||||||
}
|
}
|
||||||
|
#enableAnalytics = true # Anonymous Usage Analytics (no tracking), please support
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,19 +1,16 @@
|
|||||||
import java.nio.file.Path
|
import java.nio.file.{Path, Paths}
|
||||||
|
|
||||||
import io.gatling.commons.util.PathHelper._
|
|
||||||
|
|
||||||
object IDEPathHelper {
|
object IDEPathHelper {
|
||||||
|
val gatlingConfUrl: Path = Paths.get(getClass.getClassLoader.getResource("gatling.conf").toURI)
|
||||||
|
|
||||||
val gatlingConfUrl: Path = getClass.getClassLoader.getResource("gatling.conf")
|
val projectRootDir: Path = gatlingConfUrl.getParent.getParent.getParent
|
||||||
val projectRootDir = gatlingConfUrl.ancestor(3)
|
|
||||||
|
|
||||||
val mavenSourcesDirectory = projectRootDir / "src" / "test" / "scala"
|
val mavenSourcesDirectory: Path = projectRootDir.resolve("src").resolve("test").resolve("scala")
|
||||||
val mavenResourcesDirectory = projectRootDir / "src" / "test" / "resources"
|
val mavenResourcesDirectory: Path = projectRootDir.resolve("src").resolve("test").resolve("resources")
|
||||||
val mavenTargetDirectory = projectRootDir / "target"
|
val mavenTargetDirectory: Path = projectRootDir.resolve("target")
|
||||||
val mavenBinariesDirectory = mavenTargetDirectory / "test-classes"
|
val mavenBinariesDirectory: Path = mavenTargetDirectory.resolve("test-classes")
|
||||||
|
val resourcesDirectory: Path = mavenResourcesDirectory
|
||||||
val resourcesDirectory = mavenResourcesDirectory
|
val recorderSimulationsDirectory: Path = mavenSourcesDirectory
|
||||||
val recorderSimulationsDirectory = mavenSourcesDirectory
|
val resultsDirectory: Path = mavenTargetDirectory.resolve("gatling")
|
||||||
val resultsDirectory = mavenTargetDirectory / "gatling"
|
val recorderConfigFile: Path = mavenResourcesDirectory.resolve("recorder.conf")
|
||||||
val recorderConfigFile = mavenResourcesDirectory / "recorder.conf"
|
|
||||||
}
|
}
|
||||||
|
@ -10,15 +10,12 @@ class RecordedSimulation extends Simulation {
|
|||||||
|
|
||||||
val httpProtocol = http
|
val httpProtocol = http
|
||||||
.baseUrl("http://computer-database.gatling.io")
|
.baseUrl("http://computer-database.gatling.io")
|
||||||
.inferHtmlResources(BlackList(""".*\.css""", """.*\.js""", """.*\.ico"""), WhiteList())
|
.inferHtmlResources(WhiteList(), BlackList(""".*\.css""", """.*\.js""", """.*\.ico"""))
|
||||||
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
||||||
.acceptEncodingHeader("gzip, deflate")
|
.acceptEncodingHeader("gzip, deflate")
|
||||||
.acceptLanguageHeader("it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3")
|
.acceptLanguageHeader("it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3")
|
||||||
.userAgentHeader("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0")
|
.userAgentHeader("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val scn = scenario("RecordedSimulation")
|
val scn = scenario("RecordedSimulation")
|
||||||
.exec(http("request_0")
|
.exec(http("request_0")
|
||||||
.get("/"))
|
.get("/"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user