Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re enable HttpMetricsHandlerTests in netty5 branch (#2337)
Related to #1873 This PR is an attempt to bring back the HttpMetricsHandlerTests into netty5 branch. What has been done: - in AbstractHttpClientMetricsHandler.java: it seems that now the processed data must also be extracted from the HttpContent parameter that can be passed as argument. - Same thing done for AbstractHttpServerMetricsHandler.java: the HttpContent must be checked from the extractProcessedDataFromBuffer method. - in HttpTrafficHandler.java, it seems that the handler can't fire an event after having removed itself from the pipeline, so the removal from the pipeline is now done after the event is fired. - In AbstractHttpServerMetricsHandler.write method, sometimes the ChannelOperations seems to not be available anymore during listener invocation. This is probably caused by this Always notify FutureListener via the EventExecutor netty/netty#9489, where listeners are now invoked asynchronously. So the ChannelOperations is retrieved and cached before the listener is added. - HttpMetricsHandlerTests.java: the test has been refactored in order to always expect to observe 4 disconnects when H1 is used, and three disconnects when H2 or H2C is used. - The test is now rescheduling tasks in the event loops in order to ensure that meters are fully updated (remember that the meters are updated from listeners which are unfortunately rescheduled in event loops queue).
- Loading branch information
Showing
4 changed files
with
98 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.