Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Strokov <pstrokov@gitlab.com>2021-09-17 15:22:12 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2021-09-22 15:32:42 +0300
commit641cb8f9b6f86f4b51ce4316ce47655ef2213215 (patch)
tree89379d994f2029eb349d5516ae78189a7d3a5cfb
parenta47a975ef7d4ef51e0d68c5662d5cb3bb5b83b76 (diff)
test: Close error channel to allow multiple call for cleanup
The cleanup returned by the runPraefectServer reads for an error from the channel. If it is run multiple times it blocks on the second run as it doesn't receive data from the channel. As there is only a single send to the channel and no one sends anything else into it we close the channel. With that we can call for cleanup function multiple times without issues.
-rw-r--r--internal/praefect/helper_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/praefect/helper_test.go b/internal/praefect/helper_test.go
index 0c559047d..e6e8f53ee 100644
--- a/internal/praefect/helper_test.go
+++ b/internal/praefect/helper_test.go
@@ -200,7 +200,10 @@ func runPraefectServer(t testing.TB, ctx context.Context, conf config.Config, op
errQ := make(chan error)
ctx, cancel := context.WithCancel(ctx)
- go func() { errQ <- prf.Serve(listener) }()
+ go func() {
+ errQ <- prf.Serve(listener)
+ close(errQ)
+ }()
replMgrDone := startProcessBacklog(ctx, replmgr)
// dial client to praefect