Skip to content

Commit 38f6506

Browse files
committed
Attempt at fixing
Signed-off-by: Parthvi Vala <[email protected]> Co-authored-by: Philippe Martin <[email protected]> Co-authored-by: Armel Soro <[email protected]> Move test skip before waitgroup is initiated Signed-off-by: Parthvi Vala <[email protected]>
1 parent e9c5f86 commit 38f6506

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

tests/integration/cmd_dev_test.go

+21-11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"sort"
1414
"strconv"
1515
"strings"
16+
"sync"
1617
"time"
1718

1819
. "github.com/onsi/ginkgo/v2"
@@ -1038,23 +1039,32 @@ ComponentSettings:
10381039
var stdout string
10391040
var stderr string
10401041
BeforeEach(func() {
1041-
src := "memoryLimit: 1024Mi"
1042-
dst := "memoryLimit: 1023Mi"
1043-
helper.ReplaceString("devfile.yaml", src, dst)
10441042
if manual {
10451043
if os.Getenv("SKIP_KEY_PRESS") == "true" {
10461044
Skip("This is a unix-terminal specific scenario, skipping")
10471045
}
1048-
1046+
}
1047+
var (
1048+
wg sync.WaitGroup
1049+
err error
1050+
stdoutBytes []byte
1051+
stderrBytes []byte
1052+
)
1053+
wg.Add(1)
1054+
go func() {
1055+
defer wg.Done()
1056+
stdoutBytes, stderrBytes, ports, err = devSession.WaitSync()
1057+
Expect(err).Should(Succeed())
1058+
stdout = string(stdoutBytes)
1059+
stderr = string(stderrBytes)
1060+
}()
1061+
src := "memoryLimit: 1024Mi"
1062+
dst := "memoryLimit: 1023Mi"
1063+
helper.ReplaceString("devfile.yaml", src, dst)
1064+
if manual {
10491065
devSession.PressKey('p')
10501066
}
1051-
var err error
1052-
var stdoutBytes []byte
1053-
var stderrBytes []byte
1054-
stdoutBytes, stderrBytes, ports, err = devSession.WaitSync()
1055-
Expect(err).Should(Succeed())
1056-
stdout = string(stdoutBytes)
1057-
stderr = string(stderrBytes)
1067+
wg.Wait()
10581068
})
10591069

10601070
It(fmt.Sprintf("should react on the Devfile modification (podman=%v, manual=%v, customPortForwarding=%v)", podman, manual, customPortForwarding), func() {

0 commit comments

Comments
 (0)