diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-19 16:15:31 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-19 16:15:31 +0300 |
commit | ec0a0f597e51e48b9b73a58ef92f95b1273a61b7 (patch) | |
tree | 25036f962e0d4cfb507d8fb73061dd582d93ba3b /cmd | |
parent | 89df05730d113bd81091f91e8fae7c411cb731ca (diff) |
test: Parallel tests dependent on the PostgreSQL database
As now we create a new database on each call of the
glsql.GetDB the test execution time increased. To mitigate
that problem we make tests dependent on the PostgreSQL database
parallel. It should reduce test execution time and may help us
to find new issues in the code because of the shared global state.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/praefect/subcmd_accept_dataloss_test.go | 1 | ||||
-rw-r--r-- | cmd/praefect/subcmd_dataloss_test.go | 1 | ||||
-rw-r--r-- | cmd/praefect/subcmd_set_replication_factor_test.go | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/cmd/praefect/subcmd_accept_dataloss_test.go b/cmd/praefect/subcmd_accept_dataloss_test.go index ef5187227..8f8531833 100644 --- a/cmd/praefect/subcmd_accept_dataloss_test.go +++ b/cmd/praefect/subcmd_accept_dataloss_test.go @@ -15,6 +15,7 @@ import ( ) func TestAcceptDatalossSubcommand(t *testing.T) { + t.Parallel() const ( vs = "test-virtual-storage-1" repo = "test-repository-1" diff --git a/cmd/praefect/subcmd_dataloss_test.go b/cmd/praefect/subcmd_dataloss_test.go index 8fce062ce..a66f69d11 100644 --- a/cmd/praefect/subcmd_dataloss_test.go +++ b/cmd/praefect/subcmd_dataloss_test.go @@ -21,6 +21,7 @@ func registerPraefectInfoServer(impl gitalypb.PraefectInfoServiceServer) svcRegi } func TestDatalossSubcommand(t *testing.T) { + t.Parallel() cfg := config.Config{ VirtualStorages: []*config.VirtualStorage{ { diff --git a/cmd/praefect/subcmd_set_replication_factor_test.go b/cmd/praefect/subcmd_set_replication_factor_test.go index b2eaa0226..f55316de0 100644 --- a/cmd/praefect/subcmd_set_replication_factor_test.go +++ b/cmd/praefect/subcmd_set_replication_factor_test.go @@ -17,6 +17,7 @@ import ( ) func TestSetReplicationFactorSubcommand(t *testing.T) { + t.Parallel() db := glsql.NewDB(t) for _, tc := range []struct { |