Skip to content

Commit a0667f6

Browse files
committed
update instance termination not fulfilled test
This test can be affected by the order of the tests being run and the shared counter variable to record requests to the mock endpointer server. The fix adds a reset to the counter and a special handler to increase count.
1 parent 1d487f9 commit a0667f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/termination/termination_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ var _ = Describe("Handler Suite", func() {
175175

176176
Context("and the instance termination notice is not fulfilled", func() {
177177
BeforeEach(func() {
178-
httpHandler = newMockHTTPHandler(emptyEvents)
178+
httpHandler = newMockHTTPHandler(func(rw http.ResponseWriter, req *http.Request) {
179+
atomic.AddInt32(&counter, 1)
180+
emptyEvents(rw, req)
181+
})
179182
})
180183

181184
It("should not mark the node for deletion", func() {

0 commit comments

Comments
 (0)