Skip to content

Commit dc02b62

Browse files
Dean KarnDean Karn
authored andcommitted
Update tests
tests were running so fast on the CI server that a couple of tests were failing, so corrected the tests.
1 parent c26454b commit dc02b62

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kms_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
func reinitialize() {
2727
notify.Store(make(chan struct{}))
2828
done.Store(make(chan struct{}))
29-
hardShutdown.Store(true)
29+
AllowSignalHardShutdown(true)
3030

3131
exitFunc.Store(func(code int) {
3232
fmt.Println("Exiting")
@@ -49,9 +49,9 @@ func TestListen(t *testing.T) {
4949
Wait()
5050

5151
go func() {
52-
<-ShutdownInitiated()
5352
m.Lock()
5453
defer m.Unlock()
54+
<-ShutdownInitiated()
5555
stopping = true
5656
<-ShutdownComplete()
5757
stopped = true
@@ -86,9 +86,9 @@ func TestListen2(t *testing.T) {
8686
var stopping, stopped bool
8787

8888
go func() {
89-
<-ShutdownInitiated()
9089
m.Lock()
9190
defer m.Unlock()
91+
<-ShutdownInitiated()
9292
stopping = true
9393
<-ShutdownComplete()
9494
stopped = true
@@ -123,9 +123,9 @@ func TestListenTimeout(t *testing.T) {
123123
var stopping, stopped bool
124124

125125
go func() {
126-
<-ShutdownInitiated()
127126
m.Lock()
128127
defer m.Unlock()
128+
<-ShutdownInitiated()
129129
stopping = true
130130
<-ShutdownComplete()
131131
stopped = true
@@ -166,9 +166,9 @@ func TestListenTimeoutTimeout(t *testing.T) {
166166
var stopping, stopped bool
167167

168168
go func() {
169-
<-ShutdownInitiated()
170169
m.Lock()
171170
defer m.Unlock()
171+
<-ShutdownInitiated()
172172
stopping = true
173173
<-ShutdownComplete()
174174
stopped = true
@@ -209,9 +209,9 @@ func TestListenTimeoutDone(t *testing.T) {
209209
var stopping, stopped bool
210210

211211
go func() {
212-
<-ShutdownInitiated()
213212
m.Lock()
214213
defer m.Unlock()
214+
<-ShutdownInitiated()
215215
stopping = true
216216
<-ShutdownComplete()
217217
stopped = true
@@ -246,9 +246,9 @@ func TestListenTimeoutDoneNoHardShutdown(t *testing.T) {
246246
var stopping, stopped bool
247247

248248
go func() {
249-
<-ShutdownInitiated()
250249
m.Lock()
251250
defer m.Unlock()
251+
<-ShutdownInitiated()
252252
stopping = true
253253
<-ShutdownComplete()
254254
stopped = true

0 commit comments

Comments
 (0)