@@ -4,12 +4,13 @@ package death
4
4
5
5
import (
6
6
"errors"
7
- log "github.com/cihub/seelog"
8
- . "github.com/smartystreets/goconvey/convey"
9
7
"os"
10
8
"syscall"
11
9
"testing"
12
10
"time"
11
+
12
+ "github.com/cihub/seelog"
13
+ . "github.com/smartystreets/goconvey/convey"
13
14
)
14
15
15
16
type Unhashable map [string ]interface {}
@@ -19,7 +20,7 @@ func (u Unhashable) Close() error {
19
20
}
20
21
21
22
func TestDeath (t * testing.T ) {
22
- defer log .Flush ()
23
+ defer seelog .Flush ()
23
24
24
25
Convey ("Validate death handles unhashable types" , t , func () {
25
26
u := make (Unhashable )
@@ -59,7 +60,7 @@ func TestDeath(t *testing.T) {
59
60
death .WaitForDeath (closeMe )
60
61
So (closeMe .Closed , ShouldEqual , 1 )
61
62
})
62
-
63
+
63
64
Convey ("Validate multiple sword falls do not block even after we have exited waitForDeath" , t , func () {
64
65
death := NewDeath (syscall .SIGHUP )
65
66
closeMe := & CloseMe {}
@@ -69,7 +70,7 @@ func TestDeath(t *testing.T) {
69
70
death .FallOnSword ()
70
71
death .FallOnSword ()
71
72
So (closeMe .Closed , ShouldEqual , 1 )
72
- })
73
+ })
73
74
74
75
Convey ("Validate death gives up after timeout" , t , func () {
75
76
death := NewDeath (syscall .SIGHUP )
@@ -160,5 +161,5 @@ type CloseMe struct {
160
161
161
162
func (c * CloseMe ) Close () error {
162
163
c .Closed ++
163
- return errors .New ("I've been closed! " )
164
+ return errors .New ("I have been closed" )
164
165
}
0 commit comments