How can I test if my implementation of Transient Fault Handling Application Block works?

Topics: Transient Fault Handling Application Block ("Topaz")
Jun 13, 2013 at 12:39 AM
Hi,
I understand that these are transient errors, but I would suspect that at some point, if I hammer down a SQL Database I will get eventually throttled and could check whether my implementation of ”Topaz” actually works, right?
But how could I do that?

Best regards,
Alex
Jun 14, 2013 at 7:27 AM
One way would be to perform unit tests with either a mock strategy where an exception is thrown and the expected results verified. For example: http://stackoverflow.com/questions/13161710/unable-to-test-the-transient-fault-handling-application-block-for-azure

You also might want to take a look at the Enterprise Library Source Code. For example, FakeSqlExceptionGenerator can help in creating SqlException's with specific error codes.

Another approach would be integration testing but that is more difficult. I did find this project for Azure that floods a database to try to obtain throttling and timeouts.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to