Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make HttpMetricsHandlerTests stable (#2353)
This PR is an attempt to stabilise the HttpMetricsHandlerTests, because now in netty5, channel listeners execution is rescheduled at the end of the current event loop queue, see Netty PR #9489 (Always notify FutureListener via the EventExecutor) So, this is problem for the HttpMetricsHandlerTests tests, because when we receive a response from a server, we start to verify metrics, while the metrics may be not be already up-to-date because they are updated using write listeners, which may not be executed yet at the time the client receives the response. This PR ensures that when the server sends the last response, then all listeners are fully executed. We simply use a channel handler which is placed at the end of the pipeline. So, when the server sends the full response, the write listeners will be executed in reverse order (from left to right, so our channel handler listener will be executed lastly). Related to #1873
- Loading branch information