Wcf – How to test WCF timeout settings

timeoutunit testingwcf

How can I unit test the effect of each WCF timeout setting? I want to ensure that I select good values and I also want to make sure that my exception handling code is solid.

I created client program and a server WCF service to test the timeout settings. In my service implementation, I added a Thread.Sleep(5000). On the client-side, the only setting that causes a timeout to happen is sendTimeout.

No matter which value I use in all the other settings, the timeout never occurs.
How to I test all the other settings?

Here are the settings I would like to test: sendTimeout, receiveTimeout, closeTimeout,
openTimeout and inactivityTimeout (in reliableSessions).

Edit 19 feb 2009 : This edit is just to indicate that I still haven't found a way to unit test the WCF timeout settings.

Best Answer

Not a complete answer, but the explanation of the timeout values linked below may be helpful.

http://social.msdn.microsoft.com/forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d/