File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ type listener struct {
9
9
}
10
10
11
11
type Broadcaster struct {
12
- mu * sync.Mutex
12
+ mu sync.Mutex
13
13
t * Leadership
14
14
15
15
inner []listener
@@ -81,6 +81,5 @@ func (h *Broadcaster) CountListeners() int {
81
81
func NewSignal () * Broadcaster {
82
82
return & Broadcaster {
83
83
outer : make (chan Leadership ),
84
- mu : & sync.Mutex {},
85
84
}
86
85
}
Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ func TestLeaderShip(t *testing.T) {
43
43
}
44
44
return false
45
45
}, 2 * time .Second , 10 * time .Millisecond )
46
+ leaderCount := 0
47
+ for _ , manager := range instances {
48
+ if manager .GetSignal ().Actual ().Acquired {
49
+ leaderCount ++
50
+ }
51
+ }
52
+ require .Equal (t , 1 , leaderCount )
46
53
require .GreaterOrEqual (t , selectedLeader , 0 )
47
54
48
55
// ensure the provided db connection is still functionnal
You can’t perform that action at this time.
0 commit comments