Is it possible to simulate connection timeout?

2,119 views
Skip to first unread message

Mr.Black

unread,
May 11, 2015, 6:54:32 AM5/11/15
to wiremo...@googlegroups.com
I know, that it can simulate SocketTimeoutException by using withFixedDelay, but what about ConnectionTimeoutException?

Thanks for the answers.

Tom Akehurst

unread,
May 11, 2015, 5:11:32 PM5/11/15
to wiremo...@googlegroups.com, sfed...@griddynamics.com
WireMock.addRequestProcessingDelay() is what you're looking for. That inserts the delay before the socket.accept() call.

ash...@tibco.com

unread,
Jan 14, 2019, 8:00:48 PM1/14/19
to wiremock-user
addRequestProcessingDelay seems to have disappeared without replacement in version 2.x ? 

Is there any alternative?

Thank you in advance

Tom Akehurst

unread,
Jan 15, 2019, 12:51:38 PM1/15/19
to wiremock-user
I've not yet found a way to do this reliably in newer Java releases (which is why I removed it between v1 and 2).

The best substitute I've found is iptables/nc or tools based on them. I wrote this to help with this a bit: https://github.com/tomakehurst/saboteur/
Reply all
Reply to author
Forward
0 new messages