Skip to content

Commit

Permalink
Make HttpMetricsHandlerTests stable (#2353)
Browse files Browse the repository at this point in the history
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
pderop committed Jul 6, 2022
1 parent 9551525 commit 0f95331
Showing 1 changed file with 87 additions and 59 deletions.

0 comments on commit 0f95331

Please sign in to comment.