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:
Diffstat (limited to 'internal/testhelper/testserver.go')
-rw-r--r--internal/testhelper/testserver.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/testhelper/testserver.go b/internal/testhelper/testserver.go
index d977afce8..85563981f 100644
--- a/internal/testhelper/testserver.go
+++ b/internal/testhelper/testserver.go
@@ -143,11 +143,6 @@ func (p *TestServer) Start(t testing.TB) {
praefectServerSocketPath := GetTemporaryGitalySocketFileName(t)
- configFilePath := filepath.Join(tempDir, "config.toml")
- configFile, err := os.Create(configFilePath)
- require.NoError(t, err)
- defer configFile.Close()
-
c := praefectconfig.Config{
SocketPath: praefectServerSocketPath,
Auth: auth.Config{
@@ -178,8 +173,13 @@ func (p *TestServer) Start(t testing.TB) {
})
}
+ configFilePath := filepath.Join(tempDir, "config.toml")
+ configFile, err := os.Create(configFilePath)
+ require.NoError(t, err)
+ defer MustClose(t, configFile)
+
require.NoError(t, toml.NewEncoder(configFile).Encode(&c))
- require.NoError(t, configFile.Close())
+ require.NoError(t, configFile.Sync())
cmd := exec.Command(praefectBinPath, "-config", configFilePath)
cmd.Stderr = os.Stderr
@@ -202,7 +202,7 @@ func (p *TestServer) Start(t testing.TB) {
conn, err := grpc.Dial("unix://"+praefectServerSocketPath, opts...)
require.NoError(t, err)
- defer conn.Close()
+ defer MustClose(t, conn)
waitHealthy(t, conn, 3, time.Second)
@@ -233,7 +233,7 @@ func (p *TestServer) listen(t testing.TB) string {
conn, err := grpc.Dial("unix://"+socket, opts...)
require.NoError(t, err)
- defer conn.Close()
+ defer MustClose(t, conn)
waitHealthy(t, conn, 3, time.Second)
}