diff --git a/overlord/snapstate/snapstate_test.go b/overlord/snapstate/snapstate_test.go
index df7ea06..c1ac7bc 100644
--- a/overlord/snapstate/snapstate_test.go
+++ b/overlord/snapstate/snapstate_test.go
@@ -7161,10 +7161,7 @@ func (s *snapmgrTestSuite) TestInstallWithoutCoreTwoSnapsRunThrough(c *C) {
s.state.Unlock()
defer s.snapmgr.Stop()
- for i := 0; i < 5; i++ {
- s.settle()
- time.Sleep(10 * time.Millisecond)
- }
+ s.settle()
s.state.Lock()
// ensure all our tasks ran and core was only installed once
@@ -7195,6 +7192,7 @@ func (s *snapmgrTestSuite) TestInstallWithoutCoreTwoSnapsWithFailureRunThrough(c
restore := snapstate.MockPrerequisitesRetryTimeout(10 * time.Millisecond)
defer restore()
+ defer s.snapmgr.Stop()
// Two changes are created, the first will fails, the second will
// be fine. The order of what change runs first is random, the
// first change will also install core in its own lane. This test
@@ -7227,11 +7225,7 @@ func (s *snapmgrTestSuite) TestInstallWithoutCoreTwoSnapsWithFailureRunThrough(c
chg2.AddAll(ts2)
s.state.Unlock()
- defer s.snapmgr.Stop()
- for i := 0; i < 5; i++ {
- s.settle()
- time.Sleep(10 * time.Millisecond)
- }
+ s.settle()
s.state.Lock()
// ensure expected change states
diff --git a/overlord/state/taskrunner.go b/overlord/state/taskrunner.go
index e4303ff..18a2235 100644
--- a/overlord/state/taskrunner.go
+++ b/overlord/state/taskrunner.go
@@ -20,6 +20,8 @@
package state
import (
+ "fmt"
+
"sync"
"time"
@@ -115,6 +117,7 @@ func (r *TaskRunner) SetBlocked(pred func(t *Task, running []*Task) bool) {
// run must be called with the state lock in place
func (r *TaskRunner) run(t *Task) {
+ fmt.Println("RUN", t.Change().Summary(), t.Kind())
var handler HandlerFunc
switch t.Status() {
case DoStatus:
@@ -210,6 +213,7 @@ func (r *TaskRunner) run(t *Task) {
t.Errorf("%s", err)
}
+ fmt.Println("END", t.Change().Summary(), t.Kind(), t.Status())
return nil
})
}