Skip to content

Commit

Permalink
modified: signals_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Aug 7, 2016
1 parent c7ccffe commit cde6996
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions signals_test.go
Expand Up @@ -107,24 +107,22 @@ func TestSignals(t *testing.T) {
// test kill process will restart
old_pid := d.process.GetPid()
d.Control.fifo <- Return{err: nil, msg: "k"}
expect(t, d.count, uint32(1), "in 108")
expect(t, d.count_defer, uint32(0), "in 109")
expect(t, d.count, uint32(1), "in 110")
expect(t, d.count_defer, uint32(0), "in 111")

// wait for process to came up and then send signal "once"
for sup.IsRunning(d.process.GetPid()) {
d.Control.fifo <- Return{err: nil, msg: "o"}
for d.count_defer != 1 {
time.Sleep(time.Second)
d.Control.fifo <- Return{err: nil, msg: "o"}
break
}
expect(t, d.count, uint32(1), "in 116")
expect(t, d.count_defer, uint32(1), "in 117")
expect(t, d.count, uint32(1), "in 118")
expect(t, old_pid, d.process.GetPid())

// kill for test once
d.Control.fifo <- Return{err: nil, msg: "k"}
// process shuld not start and pids remains the same
expect(t, d.count, uint32(1), "in 123")
expect(t, d.count_defer, uint32(1), "in 124")
expect(t, d.count, uint32(1), "in 124")
expect(t, d.count_defer, uint32(1), "in 125")
expect(t, old_pid, d.process.GetPid())

for sup.IsRunning(d.process.GetPid()) {
Expand Down

0 comments on commit cde6996

Please sign in to comment.