This test depends on your system configuration and the presence of many headers.
Running the test in debug mode with address sanitizer can make it slow, so 5 seconds might not be enough.
In fact, it takes around ~10seconds here. Plus the test also fails on the CI because of the short timeout.
Increasing it to 50secs solves the problem for me.