Skip to content

Commit 4af208a

Browse files
utam0kroboquat
authored andcommitted
test: Introduction of parallelization of tests to launch workspaces
1 parent 6669a4a commit 4af208a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/tests/workspace/contexts_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ func runContextTests(t *testing.T, tests []ContextTest) {
107107
integration.SkipWithoutUsername(t, username)
108108
integration.SkipWithoutUserToken(t, userToken)
109109

110+
parallelLimiter := make(chan struct{}, 2)
111+
110112
f := features.New("context").
111113
WithLabel("component", "server").
112114
Assess("should run context tests", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
@@ -141,11 +143,20 @@ func runContextTests(t *testing.T, tests []ContextTest) {
141143
for _, ff := range ffs {
142144
for _, test := range tests {
143145
t.Run(test.ContextURL+"_"+ff.Name, func(t *testing.T) {
144-
t.Parallel()
145-
146146
if test.Skip {
147147
t.SkipNow()
148148
}
149+
t.Logf("Waiting %s", test.ContextURL+"_"+ff.Name)
150+
151+
t.Parallel()
152+
153+
parallelLimiter <- struct{}{}
154+
defer func() {
155+
<-parallelLimiter
156+
}()
157+
158+
t.Logf("Running %s", test.ContextURL+"_"+ff.Name)
159+
149160
username := username + ff.Name
150161

151162
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)

0 commit comments

Comments
 (0)