On the tip side: If connection is configurable, reduce connection string timeout to 1 second - that will make it easier. Fill the table with oodles of data and have 3 other processes spin in a loop updating chunks of that table with a transaction around the loop. Do not alter actual procedure called by the app (injecting waitfor). That invalidates an integration test.
But really, this is a case study in favor unit testing and dependency injection. Some things are just hard to integration test. Unit test + dependency injection.
- Real: Code that craps -> Database timeout (hard to reproduce).
- Refactor: Code that craps -> Repository (does data access only) ->Database
- Unit test: Code that craps > Mock repository to throw -> null
- Now you have a failing test for code that craps and can fix it.
This is "dependency" injection. The dev can inject the dependency to the database, substituting something that simulates the behavior of a dependency. Good to do for all database tests. Anyway, with the unit test in place, you know the fix does sort of what it should, but you still need an integration testing. In this case, it may better focus on regression - which means testing it didn't break anything else and the feature still works.
You've already created your patch, so I guess my answer is too late.