Skip to content

Commit 9cbb4da

Browse files
author
Dan Larkin-York
committed
Lowered keep-alive to trigger load-balancing.
1 parent 6601334 commit 9cbb4da

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

pkg/util/arangod/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ var (
6565
Proxy: nhttp.ProxyFromEnvironment,
6666
DialContext: (&net.Dialer{
6767
Timeout: 30 * time.Second,
68-
KeepAlive: 30 * time.Second,
68+
KeepAlive: 100 * time.Millisecond,
6969
DualStack: true,
7070
}).DialContext,
7171
MaxIdleConns: 100,
72-
IdleConnTimeout: 90 * time.Second,
72+
IdleConnTimeout: 100 * time.Millisecond,
7373
TLSHandshakeTimeout: 10 * time.Second,
7474
ExpectContinueTimeout: 1 * time.Second,
7575
}
7676
sharedHTTPSTransport = &nhttp.Transport{
7777
Proxy: nhttp.ProxyFromEnvironment,
7878
DialContext: (&net.Dialer{
7979
Timeout: 30 * time.Second,
80-
KeepAlive: 30 * time.Second,
80+
KeepAlive: 100 * time.Millisecond,
8181
DualStack: true,
8282
}).DialContext,
8383
MaxIdleConns: 100,
84-
IdleConnTimeout: 90 * time.Second,
84+
IdleConnTimeout: 100 * time.Millisecond,
8585
TLSHandshakeTimeout: 10 * time.Second,
8686
ExpectContinueTimeout: 1 * time.Second,
8787
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},

tests/load_balancer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"context"
2727
"reflect"
2828
"testing"
29-
//"time"
29+
"time"
3030

3131
"github.com/dchest/uniuri"
3232

@@ -250,6 +250,7 @@ func LoadBalancingCursorSubtest(t *testing.T, useVst bool) {
250250
if (wasForwarded(&r)) {
251251
someRequestForwarded = true
252252
}
253+
time.Sleep(200 * time.Millisecond)
253254
}
254255
if len(result) != len(test.ExpectedDocuments) {
255256
t.Errorf("Expected %d documents, got %d in query %d (%s)", len(test.ExpectedDocuments), len(result), i, test.Query)

tests/test_util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ func createArangodVSTConfigForDNSNames(ctx context.Context, cli corev1.CoreV1Int
103103
tlsConfig = &tls.Config{InsecureSkipVerify: true}
104104
}
105105
transport := vstProtocol.TransportConfig{
106-
Version: vstProtocol.Version1_1,
106+
IdleConnTimeout: 100 * time.Millisecond,
107+
Version: vstProtocol.Version1_1,
107108
}
108109
connConfig := vst.ConnectionConfig{
109110
TLSConfig: tlsConfig,

0 commit comments

Comments
 (0)