diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2022-05-06 12:43:32 +0400 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2022-05-06 12:44:05 +0400 |
commit | 5b5e00ce786334918883869eb24af64ccde4cf9c (patch) | |
tree | 404d1a0071943f922ba4a50b193810de934597c4 /internal/gitaly/gitaly_test.go | |
parent | c8ba21bd0c40e29cd40c7ed513c5d8a4e308a6dd (diff) | |
download | gitlab-shell-id-put-reuse-behind-ff.tar.gz |
Put reuse Gitaly connections behind feature flagid-put-reuse-behind-ff
The connections get canceled due to some shared state
Let's try disabling reusing Gitaly connections and see
whether anything changes
Diffstat (limited to 'internal/gitaly/gitaly_test.go')
-rw-r--r-- | internal/gitaly/gitaly_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/gitaly/gitaly_test.go b/internal/gitaly/gitaly_test.go index abfb764..9c8e04b 100644 --- a/internal/gitaly/gitaly_test.go +++ b/internal/gitaly/gitaly_test.go @@ -37,17 +37,21 @@ func TestCachedConnections(t *testing.T) { cmd := Command{ServiceName: "git-upload-pack", Address: "tcp://localhost:9999"} - conn, err := c.GetConnection(context.Background(), cmd) + conn, err := c.GetConnection(context.Background(), false, cmd) + require.NoError(t, err) + require.Len(t, c.cache.connections, 0) + + conn, err = c.GetConnection(context.Background(), true, cmd) require.NoError(t, err) require.Len(t, c.cache.connections, 1) - newConn, err := c.GetConnection(context.Background(), cmd) + newConn, err := c.GetConnection(context.Background(), true, cmd) require.NoError(t, err) require.Len(t, c.cache.connections, 1) require.Equal(t, conn, newConn) cmd = Command{ServiceName: "git-upload-pack", Address: "tcp://localhost:9998"} - _, err = c.GetConnection(context.Background(), cmd) + _, err = c.GetConnection(context.Background(), true, cmd) require.NoError(t, err) require.Len(t, c.cache.connections, 2) } |