You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you see instead? Under which circumstances?
The first-executed @Test method worked fine, but the second failed in AbstractOperatorExtension.beforeEach() because the previously-executed afterEach closed the kubernetes client given to the extension via Operator.stop.
This is surprising to me because my default assumption (when passing a client instance which I've instantiated to some API) is that I remain responsible for closing that client. There is no javadoc to say exactly what the contract of the withKubernetesClient(client) method actually is.
Environment
N/A
Possible Solution
Either:
Don't close the client passed via withKubernetesClient, and document the expectation that it's the callers job to close it.
Or document that responsibility for closing the client passes to the extension when withKubernetesClient is called.
Additional context
The text was updated successfully, but these errors were encountered:
Bug Report
What did you do?
I wrote a test class with 2
@Test
methods using aLocallyRunOperatorExtension
with an externally-given kubernetes client:What did you expect to see?
Both test methods to be executed
What did you see instead? Under which circumstances?
The first-executed
@Test
method worked fine, but the second failed inAbstractOperatorExtension.beforeEach()
because the previously-executedafterEach
closed the kubernetes client given to the extension viaOperator.stop
.Here's the stack where the client gets closed:
This is surprising to me because my default assumption (when passing a client instance which I've instantiated to some API) is that I remain responsible for closing that client. There is no javadoc to say exactly what the contract of the
withKubernetesClient(client)
method actually is.Environment
N/A
Possible Solution
Either:
withKubernetesClient
, and document the expectation that it's the callers job to close it.withKubernetesClient
is called.Additional context
The text was updated successfully, but these errors were encountered: