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
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,
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:

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
Enterprise Library support engineer
Support How-to