You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by zh...@apache.org on 2021/10/08 03:15:56 UTC

[skywalking-infra-e2e] branch run/stop_trigger created (now 51a82d5)

This is an automated email from the ASF dual-hosted git repository.

zhangwei24 pushed a change to branch run/stop_trigger
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git.


      at 51a82d5  Fix: stop trigger when cleanup

This branch includes the following new commits:

     new 51a82d5  Fix: stop trigger when cleanup

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[skywalking-infra-e2e] 01/01: Fix: stop trigger when cleanup

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhangwei24 pushed a commit to branch run/stop_trigger
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit 51a82d55eabf6020fde72f00b9287bd1f1386376
Author: zhangwei <zh...@apache.org>
AuthorDate: Fri Oct 8 11:06:34 2021 +0800

    Fix: stop trigger when cleanup
---
 commands/run/run.go | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/commands/run/run.go b/commands/run/run.go
index 09577d3..c7566e6 100644
--- a/commands/run/run.go
+++ b/commands/run/run.go
@@ -49,10 +49,15 @@ func runAccordingE2E() error {
 	}
 
 	var action t.Action
+	stopAction := func() {
+		if action != nil {
+			action.Stop()
+		}
+	}
 	// If cleanup.on == Always and there is error in setup step, we should defer cleanup step right now.
 	cleanupOnCondition := config.GlobalConfig.E2EConfig.Cleanup.On
 	if cleanupOnCondition == constant.CleanUpAlways {
-		defer doCleanup(action)
+		defer doCleanup(stopAction)
 	}
 
 	// setup part
@@ -72,7 +77,7 @@ func runAccordingE2E() error {
 				return
 			}
 
-			doCleanup(action)
+			doCleanup(stopAction)
 		}()
 	}
 
@@ -97,9 +102,9 @@ func runAccordingE2E() error {
 	return nil
 }
 
-func doCleanup(action t.Action) {
-	if action != nil {
-		action.Stop()
+func doCleanup(stopAction func()) {
+	if stopAction != nil {
+		stopAction()
 	}
 	if err := cleanup.DoCleanupAccordingE2E(); err != nil {
 		logger.Log.Errorf("cleanup part error: %s", err)