fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.35k stars 1.45k forks source link

Create test to ensure HttpLoggingInterceptor doesn't consume bytes #5251

Closed manusa closed 8 months ago

manusa commented 1 year ago

Description

Relates to #5250

In #5146 we removed by mistake the copy instruction for the consumed ByteBuffer. This has basically reintroduced the problems (https://github.com/eclipse/jkube/issues/2000, https://github.com/eclipse/jkube/issues/1950) that were originally addressed by our HttpLoggingInterceptor feature.

We need to add a specific test to ensure that this is not a problem again.

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

rohanKanojia commented 8 months ago

We need to add a specific test to ensure that this is not a problem again.

I can reproduce the original issue using a unit test in AbstractHttpLoggingInterceptorTest, by test do you mean a unit test or an E2E test (in kubernetes-itests)?

manusa commented 8 months ago

A black-boxed unit test that ensures the behavior (i.e. avoid mocking and verify calls to things like BufferUtil::copy)

rohanKanojia commented 8 months ago

I see only logger being mocked in AbstractHttpLoggingInterceptorTest. Could you please check if #5532 matches your expectations?