Ubuntu Pastebin

Paste from pedronis at Thu, 7 Sep 2017 12:14:19 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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
 	})
 }
Download as text