mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
Revert hack to handle SIGTERM in e2e tests.
This commit is contained in:
@@ -18,12 +18,9 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
@@ -57,23 +54,6 @@ func init() {
|
|||||||
|
|
||||||
func (t *testResult) Fail() { *t = false }
|
func (t *testResult) Fail() { *t = false }
|
||||||
|
|
||||||
// Convert any received TERM signals into INT signals.
|
|
||||||
// The Ginkgo runner only handles SIGINT, so if Jenkins aborts a run,
|
|
||||||
// we lose all reporting unless we also handle SIGTERM.
|
|
||||||
// This function never returns.
|
|
||||||
func convertSigTermIntoInterrupt() {
|
|
||||||
p, err := os.FindProcess(os.Getpid())
|
|
||||||
if err != nil {
|
|
||||||
glog.Fatalf("Failed looking up own process: %s", err.Error())
|
|
||||||
}
|
|
||||||
c := make(chan os.Signal, 1)
|
|
||||||
signal.Notify(c, syscall.SIGTERM)
|
|
||||||
for {
|
|
||||||
<-c
|
|
||||||
p.Signal(os.Interrupt)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run each Go end-to-end-test. This function assumes the
|
// Run each Go end-to-end-test. This function assumes the
|
||||||
// creation of a test cluster.
|
// creation of a test cluster.
|
||||||
func RunE2ETests(context *TestContextType, orderseed int64, times int, reportDir string, testList []string) {
|
func RunE2ETests(context *TestContextType, orderseed int64, times int, reportDir string, testList []string) {
|
||||||
@@ -81,7 +61,6 @@ func RunE2ETests(context *TestContextType, orderseed int64, times int, reportDir
|
|||||||
util.ReallyCrash = true
|
util.ReallyCrash = true
|
||||||
util.InitLogs()
|
util.InitLogs()
|
||||||
defer util.FlushLogs()
|
defer util.FlushLogs()
|
||||||
go convertSigTermIntoInterrupt()
|
|
||||||
|
|
||||||
if len(testList) != 0 {
|
if len(testList) != 0 {
|
||||||
if config.GinkgoConfig.FocusString != "" || config.GinkgoConfig.SkipString != "" {
|
if config.GinkgoConfig.FocusString != "" || config.GinkgoConfig.SkipString != "" {
|
||||||
|
Reference in New Issue
Block a user