Skip to content

Commit

Permalink
Change after function in e2e tests to make agents to leave before clo…
Browse files Browse the repository at this point in the history
…sing
  • Loading branch information
aalda committed Feb 25, 2019
1 parent deec0c9 commit 71e0e03
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions tests/e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ func setupAuditor(id int, t *testing.T) (scope.TestF, scope.TestF) {
after := func(t *testing.T) {
if au != nil {
au.Shutdown()
_ = agent.Shutdown()
} else {
t.Fatalf("Unable to shutdown the auditor!")
}
err := agent.Leave()
if err != nil {
t.Fatalf("Unable to shutdown the auditor: %v", err)
}
err = agent.Shutdown()
if err != nil {
t.Fatalf("Unable to shutdown the auditor: %v", err)
}
}
return before, after
Expand Down Expand Up @@ -133,9 +138,14 @@ func setupMonitor(id int, t *testing.T) (scope.TestF, scope.TestF) {
after := func(t *testing.T) {
if mn != nil {
mn.Shutdown()
_ = agent.Shutdown()
} else {
t.Fatalf("Unable to shutdown the monitor!")
}
err := agent.Leave()
if err != nil {
t.Fatalf("Unable to shutdown the monitor: %v", err)
}
err = agent.Shutdown()
if err != nil {
t.Fatalf("Unable to shutdown the monitor: %v", err)
}
}
return before, after
Expand All @@ -162,9 +172,14 @@ func setupPublisher(id int, t *testing.T) (scope.TestF, scope.TestF) {
after := func(t *testing.T) {
if pu != nil {
pu.Shutdown()
_ = agent.Shutdown()
} else {
t.Fatalf("Unable to shutdown the publisher!")
}
err := agent.Leave()
if err != nil {
t.Fatalf("Unable to shutdown the publisher: %v", err)
}
err = agent.Shutdown()
if err != nil {
t.Fatalf("Unable to shutdown the publisher: %v", err)
}
}
return before, after
Expand Down

0 comments on commit 71e0e03

Please sign in to comment.