Skip to content

Commit 3326b2f

Browse files
author
Tim Middleton
authored
Increase timeouts for test for take account of slower machines (#52)
* Increase timeouts for test for take account of slower machines * More test updates
1 parent d776c7e commit 3326b2f

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

coherence/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ func validateFilePath(file string) error {
691691
// String returns a string representation of SessionOptions.
692692
func (s *SessionOptions) String() string {
693693
var sb = strings.Builder{}
694-
sb.WriteString(fmt.Sprintf("SessionOptions{address=%v, plainText=%v, scope=%v, format=%v, request timeout=%v, disconnect timeout=%v, ready timeout=%v",
694+
sb.WriteString(fmt.Sprintf("SessionOptions{address=%v, plainText=%v, scope=%v, format=%v, requestTimeout=%v, disconnectTimeout=%v, readyTimeout=%v",
695695
s.Address, s.PlainText, s.Scope, s.Format, s.RequestTimeout, s.DisconnectTimeout, s.ReadyTimeout))
696696

697697
if !s.PlainText {

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
<jvmFlag>-Dcoherence.security.key=${coherence.security.key}</jvmFlag>
217217
<jvmFlag>-Dcoherence.security.cert=${coherence.security.cert}</jvmFlag>
218218
<jvmFlag>-Dcoherence.security.ca.cert=${coherence.security.ca.cert}</jvmFlag>
219-
<jvmFlag>-Dcoherence.io.json.debug=true</jvmFlag>
219+
<!-- uncomment for JSSON debug, <jvmFlag>-Dcoherence.io.json.debug=true</jvmFlag>-->
220220
<jvmFlag>-Dcoherence.log.level=9</jvmFlag>
221221
<jvmFlag>-Dcoherence.distributed.localstorage=true</jvmFlag>
222222
<jvmFlag>-Dcoherence.management.refresh.expiry=1s</jvmFlag>

test/e2e/standalone/event_test.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ func TestEventDisconnect(t *testing.T) {
109109
t.Setenv("COHERENCE_SESSION_DEBUG", "true")
110110
//g, session := initTest(t)
111111
g, session := initTest(t,
112-
coherence.WithDisconnectTimeout(time.Duration(130000)*time.Millisecond),
113-
coherence.WithReadyTimeout(time.Duration(70)*time.Second))
112+
coherence.WithDisconnectTimeout(time.Duration(130)*time.Second),
113+
coherence.WithReadyTimeout(time.Duration(130)*time.Second))
114114
defer session.Close()
115115

116116
namedCache := GetNamedCache[string, string](g, session, "test-reconnect-cache")
@@ -132,7 +132,7 @@ func TestEventDisconnectWithReadyTimeoutDelay(t *testing.T) {
132132
t.Error("Unable to issue post request to stop gRPC proxy")
133133
}
134134

135-
g, session := initTest(t, coherence.WithReadyTimeout(time.Duration(130000)*time.Millisecond))
135+
g, session := initTest(t, coherence.WithReadyTimeout(time.Duration(130)*time.Second))
136136
defer session.Close()
137137

138138
namedCache := GetNamedCache[string, string](g, session, "test-reconnect-cache")
@@ -275,11 +275,19 @@ func RunTestReconnect(g *gomega.WithT, namedMap coherence.NamedMap[string, strin
275275
// issue a stop, which better simulates a sudden disconnect
276276
// vs shutdown (which is graceful), for the "$GRPC:GrpcProxy" on node 1.
277277
// the client should eventually connect
278-
fmt.Println("Issue stop of $GRPC:GrpcProxy")
278+
log.Println("Issue stop of $GRPC:GrpcProxy")
279279
_, err = IssuePostRequest("http://127.0.0.1:30000/management/coherence/cluster/services/$GRPC:GrpcProxy/members/1/stop")
280280
g.Expect(err).ShouldNot(gomega.HaveOccurred())
281281
}
282282

283+
// get the size to force reconnect
284+
log.Println("Issue Size() to force reconnect")
285+
_, err = namedMap.Size(ctx)
286+
g.Expect(err).ShouldNot(gomega.HaveOccurred())
287+
288+
log.Println("Sleeping to test re-connect")
289+
Sleep(5)
290+
283291
// add another 'additional' mutations
284292
createMutations(g, namedMap, additional)
285293

@@ -295,6 +303,7 @@ func RunTestReconnect(g *gomega.WithT, namedMap coherence.NamedMap[string, strin
295303
// createMutations creates a specified number of data mutations.
296304
func createMutations(g *gomega.WithT, namedMap coherence.NamedMap[string, string], iters int) {
297305
var err error
306+
log.Println("createMutations, iters=", iters)
298307
for i := 0; i < iters; i++ {
299308
key := fmt.Sprintf("key-%d", i)
300309
value := fmt.Sprintf("value-%d", i)

0 commit comments

Comments
 (0)