@@ -17,12 +17,12 @@ import datadog.trace.bootstrap.instrumentation.api.Tags
17
17
import datadog.trace.core.DDSpan
18
18
import org.slf4j.Logger
19
19
import org.slf4j.LoggerFactory
20
-
21
- import java.time.Duration
22
20
import org.testcontainers.couchbase.BucketDefinition
23
21
import org.testcontainers.couchbase.CouchbaseContainer
24
22
import spock.lang.Shared
25
23
24
+ import java.time.Duration
25
+
26
26
import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
27
27
import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
28
28
@@ -39,12 +39,28 @@ abstract class CouchbaseClient31Test extends VersionedNamingTestBase {
39
39
Bucket bucket
40
40
41
41
def setupSpec () {
42
+ LOGGER . info(" [raph] ${ this.getClass().getSimpleName()} setup starting at ${ new Date()} " )
43
+
42
44
def arch = System . getProperty(" os.arch" ) == " aarch64" ? " -aarch64" : " "
43
45
couchbase = new CouchbaseContainer (" couchbase/server:7.1.0${ arch} " )
44
46
.withBucket(new BucketDefinition (BUCKET ). withPrimaryIndex(true ))
45
- .withStartupTimeout(Duration . ofSeconds(240 ))
46
- .withStartupAttempts(3 )
47
- couchbase. start()
47
+ .withStartupTimeout(Duration . ofSeconds(100 ))
48
+ .withStartupAttempts(1 )
49
+
50
+ long startTime = System . nanoTime()
51
+ try {
52
+ couchbase. start()
53
+ }
54
+ catch (Exception e) {
55
+ double durationSeconds = (System . nanoTime() - startTime) / 1e9
56
+ LOGGER . error(" [raph] caught error after ${ String.format('%.1f', durationSeconds)} s, gonna retry\n " + e. toString())
57
+ couchbase. start()
58
+ } finally {
59
+ double durationSeconds = (System . nanoTime() - startTime) / 1e9
60
+ LOGGER . info(" [raph] couchbase.start took ${ String.format('%.1f', durationSeconds)} s" )
61
+ }
62
+
63
+ LOGGER . info(" [raph] if this log is printed, then there was no error in starting couchbase" )
48
64
49
65
ClusterEnvironment environment = ClusterEnvironment . builder()
50
66
.timeoutConfig(TimeoutConfig . kvTimeout(Duration . ofSeconds(10 )))
@@ -63,6 +79,9 @@ abstract class CouchbaseClient31Test extends VersionedNamingTestBase {
63
79
insertData(bucket, " $type $it " , something, orOther)
64
80
}
65
81
cluster. queryIndexes(). createIndex(BUCKET , ' test-index' , Arrays . asList(' something' , ' or_other' ))
82
+
83
+ double durationSeconds = (System . nanoTime() - startTime) / 1e9
84
+ LOGGER . info(" [raph] couchbase.start + rest of the setup took ${ String.format('%.1f', durationSeconds)} s" )
66
85
}
67
86
68
87
def cleanupSpec () {
@@ -83,6 +102,7 @@ abstract class CouchbaseClient31Test extends VersionedNamingTestBase {
83
102
}
84
103
85
104
def " check basic spans" () {
105
+ LOGGER . info(" [raph] first test is being run" )
86
106
setup :
87
107
def collection = bucket. defaultCollection()
88
108
@@ -104,6 +124,7 @@ abstract class CouchbaseClient31Test extends VersionedNamingTestBase {
104
124
assertCouchbaseDispatchCall(it, span(0 ))
105
125
}
106
126
}
127
+ LOGGER . info(" [raph] end of first test (if this is printed, I think it means it was successful ?)" )
107
128
}
108
129
109
130
def " check basic error spans with internal spans enabled #internalEnabled" () {
0 commit comments