aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/infra/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/infra/container.go')
-rw-r--r--extras/hs-test/infra/container.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/extras/hs-test/infra/container.go b/extras/hs-test/infra/container.go
index 44f141a9102..46cee976556 100644
--- a/extras/hs-test/infra/container.go
+++ b/extras/hs-test/infra/container.go
@@ -468,12 +468,12 @@ func (c *Container) log(maxLines int) (string, error) {
stdout := stdoutBuf.String()
stderr := stderrBuf.String()
- if strings.Contains(stdout, "==> /dev/null <==") {
- stdout = ""
- }
- if strings.Contains(stderr, "tail: cannot open") {
- stderr = ""
- }
+ stdout = strings.Join(strings.Split(stdout, "==> /dev/null <=="), "")
+ stderr = strings.Join(strings.Split(stderr, "tail: cannot open '' for reading: No such file or directory"), "")
+
+ // remove empty lines after deleting the above-mentioned messages
+ stdout = strings.TrimSpace(stdout)
+ stderr = strings.TrimSpace(stderr)
return stdout + stderr, err
}