mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Do not set stop-services=false for node e2e and add more logs.
This commit is contained in:
parent
f839c5ffdf
commit
e7a1b4e16f
@ -168,7 +168,7 @@ else
|
||||
# Test using the host the script was run on
|
||||
# Provided for backwards compatibility
|
||||
go run test/e2e_node/runner/local/run_local.go --ginkgo-flags="$ginkgoflags" \
|
||||
--test-flags="--alsologtostderr --v 2 --report-dir=${report} --node-name $(hostname) \
|
||||
--start-services=true --stop-services=true $test_args" --build-dependencies=true
|
||||
--test-flags="--alsologtostderr --v 4 --report-dir=${report} --node-name $(hostname) \
|
||||
$test_args" --build-dependencies=true
|
||||
exit $?
|
||||
fi
|
||||
|
@ -195,8 +195,8 @@ func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string
|
||||
// Run the tests
|
||||
cmd = getSshCommand(" && ",
|
||||
fmt.Sprintf("cd %s", tmp),
|
||||
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --logtostderr --v 2 --stop-services=%t --node-name=%s --report-dir=%s/results --report-prefix=%s %s",
|
||||
testTimeoutSeconds.Seconds(), ginkgoFlags, cleanup, host, tmp, junitFilePrefix, testArgs),
|
||||
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --logtostderr --v 4 --node-name=%s --report-dir=%s/results --report-prefix=%s %s",
|
||||
testTimeoutSeconds.Seconds(), ginkgoFlags, host, tmp, junitFilePrefix, testArgs),
|
||||
)
|
||||
aggErrs := []error{}
|
||||
|
||||
|
@ -87,6 +87,7 @@ func (e *E2EServices) Start() error {
|
||||
// "--cgroups-per-qos="+strconv.FormatBool(framework.TestContext.CgroupsPerQOS),
|
||||
"--manifest-path", framework.TestContext.ManifestPath,
|
||||
"--eviction-hard", framework.TestContext.EvictionHard,
|
||||
"--logtostderr",
|
||||
)
|
||||
e.services = newServer("services", startCmd, nil, nil, getHealthCheckURLs(), servicesLogFile, false)
|
||||
return e.services.start()
|
||||
@ -195,6 +196,7 @@ func (es *e2eService) run() error {
|
||||
}
|
||||
|
||||
func (es *e2eService) start() error {
|
||||
glog.Info("Starting e2e services...")
|
||||
err := es.startEtcd()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -215,7 +217,7 @@ func (es *e2eService) start() error {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
glog.Info("E2E services started.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -226,6 +228,7 @@ func (es *e2eService) getLogFiles() {
|
||||
if framework.TestContext.ReportDir == "" {
|
||||
return
|
||||
}
|
||||
glog.Info("Fetching log files...")
|
||||
journaldFound := isJournaldAvailable()
|
||||
for targetFileName, logFileData := range es.logFiles {
|
||||
targetLink := path.Join(framework.TestContext.ReportDir, targetFileName)
|
||||
@ -234,6 +237,7 @@ func (es *e2eService) getLogFiles() {
|
||||
if len(logFileData.journalctlCommand) == 0 {
|
||||
continue
|
||||
}
|
||||
glog.Infof("Get log file %q with journalctl command %v.", targetFileName, logFileData.journalctlCommand)
|
||||
out, err := exec.Command("sudo", append([]string{"journalctl"}, logFileData.journalctlCommand...)...).CombinedOutput()
|
||||
if err != nil {
|
||||
glog.Errorf("failed to get %q from journald: %v, %v", targetFileName, string(out), err)
|
||||
@ -275,6 +279,7 @@ func isJournaldAvailable() bool {
|
||||
}
|
||||
|
||||
func (es *e2eService) stop() {
|
||||
glog.Info("Stopping e2e services...")
|
||||
es.getLogFiles()
|
||||
// TODO(random-liu): Use a loop to stop all services after introducing service interface.
|
||||
// Stop namespace controller
|
||||
@ -306,6 +311,7 @@ func (es *e2eService) stop() {
|
||||
glog.Errorf("Failed to delete directory %s.\n%v", d, err)
|
||||
}
|
||||
}
|
||||
glog.Info("E2E services stopped.")
|
||||
}
|
||||
|
||||
func (es *e2eService) startEtcd() error {
|
||||
@ -496,6 +502,7 @@ func readinessCheck(urls []string, errCh <-chan error) error {
|
||||
|
||||
// Note: restartOnExit == true requires len(s.healthCheckUrls) > 0 to work properly.
|
||||
func (s *server) start() error {
|
||||
glog.Infof("Start server %q with command %q", s.name, commandToString(s.startCommand))
|
||||
errCh := make(chan error)
|
||||
|
||||
var stopRestartingCh, ackStopRestartingCh chan bool
|
||||
@ -634,6 +641,7 @@ func (s *server) start() error {
|
||||
}
|
||||
|
||||
func (s *server) kill() error {
|
||||
glog.Infof("Kill server %q", s.name)
|
||||
name := s.name
|
||||
cmd := s.startCommand
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user