Merge pull request #515 from DataDog/mar-kolya/new-groovy
Use newer Groovy, Gradle, Spock
This commit is contained in:
commit
655d490da2
|
@ -17,7 +17,7 @@ class ClassLoadingTest extends Specification {
|
||||||
/** Assert that we can instrument classloaders which cannot resolve agent advice classes. */
|
/** Assert that we can instrument classloaders which cannot resolve agent advice classes. */
|
||||||
def "instrument classloader without agent classes"() {
|
def "instrument classloader without agent classes"() {
|
||||||
setup:
|
setup:
|
||||||
final URLClassLoader loader = new URLClassLoader(classpath, (ClassLoader) null)
|
URLClassLoader loader = new URLClassLoader(classpath, (ClassLoader) null)
|
||||||
|
|
||||||
when:
|
when:
|
||||||
loader.loadClass("datadog.agent.TracingAgent")
|
loader.loadClass("datadog.agent.TracingAgent")
|
||||||
|
@ -25,15 +25,15 @@ class ClassLoadingTest extends Specification {
|
||||||
thrown ClassNotFoundException
|
thrown ClassNotFoundException
|
||||||
|
|
||||||
when:
|
when:
|
||||||
final Class<?> instrumentedClass = loader.loadClass(ClassToInstrument.getName())
|
Class<?> instrumentedClass = loader.loadClass(ClassToInstrument.getName())
|
||||||
then:
|
then:
|
||||||
instrumentedClass.getClassLoader() == loader
|
instrumentedClass.getClassLoader() == loader
|
||||||
}
|
}
|
||||||
|
|
||||||
def "make sure ByteBuddy does not hold strong references to ClassLoader"() {
|
def "make sure ByteBuddy does not hold strong references to ClassLoader"() {
|
||||||
setup:
|
setup:
|
||||||
final URLClassLoader loader = new URLClassLoader(classpath, (ClassLoader) null)
|
URLClassLoader loader = new URLClassLoader(classpath, (ClassLoader) null)
|
||||||
final WeakReference<URLClassLoader> ref = new WeakReference<>(loader)
|
WeakReference<URLClassLoader> ref = new WeakReference<>(loader)
|
||||||
|
|
||||||
when:
|
when:
|
||||||
loader.loadClass(ClassToInstrument.getName())
|
loader.loadClass(ClassToInstrument.getName())
|
||||||
|
@ -45,7 +45,7 @@ class ClassLoadingTest extends Specification {
|
||||||
null == ref.get()
|
null == ref.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are doing this because Grovy cannot properly resolve constructor argument types in anonymous classes
|
// We are doing this because Groovy cannot properly resolve constructor argument types in anonymous classes
|
||||||
static class CountingClassLoader extends URLClassLoader {
|
static class CountingClassLoader extends URLClassLoader {
|
||||||
public int count = 0
|
public int count = 0
|
||||||
|
|
||||||
|
@ -62,9 +62,10 @@ class ClassLoadingTest extends Specification {
|
||||||
|
|
||||||
def "make sure that ByteBuddy reads classes's bytes only once"() {
|
def "make sure that ByteBuddy reads classes's bytes only once"() {
|
||||||
setup:
|
setup:
|
||||||
final CountingClassLoader loader = new CountingClassLoader(classpath)
|
CountingClassLoader loader = new CountingClassLoader(classpath)
|
||||||
|
|
||||||
when:
|
when:
|
||||||
|
//loader.loadClass("aaa")
|
||||||
loader.loadClass(ClassToInstrument.getName())
|
loader.loadClass(ClassToInstrument.getName())
|
||||||
int countAfterFirstLoad = loader.count
|
int countAfterFirstLoad = loader.count
|
||||||
loader.loadClass(ClassToInstrumentChild.getName())
|
loader.loadClass(ClassToInstrumentChild.getName())
|
||||||
|
@ -77,8 +78,8 @@ class ClassLoadingTest extends Specification {
|
||||||
|
|
||||||
def "make sure that ByteBuddy doesn't resue cached type descriptions between different classloaders"() {
|
def "make sure that ByteBuddy doesn't resue cached type descriptions between different classloaders"() {
|
||||||
setup:
|
setup:
|
||||||
final CountingClassLoader loader1 = new CountingClassLoader(classpath)
|
CountingClassLoader loader1 = new CountingClassLoader(classpath)
|
||||||
final CountingClassLoader loader2 = new CountingClassLoader(classpath)
|
CountingClassLoader loader2 = new CountingClassLoader(classpath)
|
||||||
|
|
||||||
when:
|
when:
|
||||||
loader1.loadClass(ClassToInstrument.getName())
|
loader1.loadClass(ClassToInstrument.getName())
|
||||||
|
|
|
@ -115,7 +115,7 @@ abstract class AbstractCouchbaseTest extends AgentTestRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private DefaultCouchbaseEnvironment.Builder envBuilder(BucketSettings bucketSettings) {
|
private DefaultCouchbaseEnvironment.Builder envBuilder(BucketSettings bucketSettings) {
|
||||||
def timeout = TimeUnit.SECONDS.toMillis(5)
|
def timeout = TimeUnit.SECONDS.toMillis(10)
|
||||||
return DefaultCouchbaseEnvironment.builder()
|
return DefaultCouchbaseEnvironment.builder()
|
||||||
.bootstrapCarrierDirectPort(mock.getCarrierPort(bucketSettings.name()))
|
.bootstrapCarrierDirectPort(mock.getCarrierPort(bucketSettings.name()))
|
||||||
.bootstrapHttpDirectPort(port)
|
.bootstrapHttpDirectPort(port)
|
||||||
|
@ -124,9 +124,14 @@ abstract class AbstractCouchbaseTest extends AgentTestRunner {
|
||||||
.networkLatencyMetricsCollectorConfig(DefaultLatencyMetricsCollectorConfig.create(0, TimeUnit.DAYS))
|
.networkLatencyMetricsCollectorConfig(DefaultLatencyMetricsCollectorConfig.create(0, TimeUnit.DAYS))
|
||||||
.computationPoolSize(1)
|
.computationPoolSize(1)
|
||||||
.connectTimeout(timeout)
|
.connectTimeout(timeout)
|
||||||
|
.disconnectTimeout(timeout)
|
||||||
.kvTimeout(timeout)
|
.kvTimeout(timeout)
|
||||||
.managementTimeout(timeout)
|
.managementTimeout(timeout)
|
||||||
.queryTimeout(timeout)
|
.queryTimeout(timeout)
|
||||||
.viewTimeout(timeout)
|
.viewTimeout(timeout)
|
||||||
|
.keepAliveTimeout(timeout)
|
||||||
|
.searchTimeout(timeout)
|
||||||
|
.analyticsTimeout(timeout)
|
||||||
|
.socketConnectTimeout(timeout.intValue())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class GrpcStreamingTest extends AgentTestRunner {
|
||||||
|
|
||||||
def "test conversation #name"() {
|
def "test conversation #name"() {
|
||||||
setup:
|
setup:
|
||||||
final msgCount = serverMessageCount
|
def msgCount = serverMessageCount
|
||||||
def serverReceived = new CopyOnWriteArrayList<>()
|
def serverReceived = new CopyOnWriteArrayList<>()
|
||||||
def clientReceived = new CopyOnWriteArrayList<>()
|
def clientReceived = new CopyOnWriteArrayList<>()
|
||||||
def error = new AtomicReference()
|
def error = new AtomicReference()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
def groovyVer = GroovySystem.version
|
def groovyVer = "2.5.2"
|
||||||
def spockGroovyVer = GroovySystem.version.replaceAll(/\.\d+$/, '')
|
def spockGroovyVer = groovyVer.replaceAll(/\.\d+$/, '')
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
versions = [
|
versions = [
|
||||||
|
@ -10,7 +10,7 @@ ext {
|
||||||
jackson : "2.6.3", // This is a transitive dependency for the tracer.
|
jackson : "2.6.3", // This is a transitive dependency for the tracer.
|
||||||
// Use an old version to not force an upgrade for others using tracer as a dependency.
|
// Use an old version to not force an upgrade for others using tracer as a dependency.
|
||||||
|
|
||||||
spock : "1.1-groovy-$spockGroovyVer",
|
spock : "1.2-groovy-$spockGroovyVer",
|
||||||
groovy : groovyVer,
|
groovy : groovyVer,
|
||||||
junit : "4.12",
|
junit : "4.12",
|
||||||
logback : "1.2.3",
|
logback : "1.2.3",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#Wed Sep 26 11:49:09 EDT 2018
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||||
|
|
Loading…
Reference in New Issue