e2e: bump ginkgo to v2.2.0

The new release adds support for intermediate progress reports.
This commit is contained in:
Patrick Ohly
2022-09-09 15:47:46 +02:00
parent 178f246bbc
commit 1e4edaf2fe
53 changed files with 1002 additions and 181 deletions

View File

@@ -4,12 +4,10 @@ import (
"fmt"
"os"
"os/signal"
"runtime"
"sync"
"syscall"
"time"
"github.com/onsi/ginkgo/v2/formatter"
"github.com/onsi/ginkgo/v2/internal/parallel_support"
)
@@ -50,7 +48,7 @@ type InterruptHandlerInterface interface {
Status() InterruptStatus
SetInterruptPlaceholderMessage(string)
ClearInterruptPlaceholderMessage()
InterruptMessageWithStackTraces() string
InterruptMessage() (string, bool)
}
type InterruptHandler struct {
@@ -190,23 +188,9 @@ func (handler *InterruptHandler) ClearInterruptPlaceholderMessage() {
handler.interruptPlaceholderMessage = ""
}
func (handler *InterruptHandler) InterruptMessageWithStackTraces() string {
func (handler *InterruptHandler) InterruptMessage() (string, bool) {
handler.lock.Lock()
out := fmt.Sprintf("%s\n\n", handler.interruptCause.String())
out := fmt.Sprintf("%s", handler.interruptCause.String())
defer handler.lock.Unlock()
if handler.interruptCause == InterruptCauseAbortByOtherProcess {
return out
}
out += "Here's a stack trace of all running goroutines:\n"
buf := make([]byte, 8192)
for {
n := runtime.Stack(buf, true)
if n < len(buf) {
buf = buf[:n]
break
}
buf = make([]byte, 2*len(buf))
}
out += formatter.Fi(1, "%s", string(buf))
return out
return out, handler.interruptCause != InterruptCauseAbortByOtherProcess
}