Skip to content

Commit 0e3cf68

Browse files
Merge pull request #77 from elmiko/fix-termination-handler-unit-tests
OCPBUGS-20268: update bad url endpoint termination handler test
2 parents 2f90c4f + a0667f6 commit 0e3cf68

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/termination/termination_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,19 @@ 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() {
182185
Consistently(nodeMarkedForDeletion(testNode.Name)).Should(BeFalse())
183186
})
184187
})
188+
})
185189

190+
Context("when the termination endpoint is invalid", func() {
186191
Context("and the poll URL cannot be reached", func() {
187192
BeforeEach(func() {
188193
h.pollURL = &url.URL{Opaque: "abc#1://localhost"}

0 commit comments

Comments
 (0)