Reputation: 4594
I am running circa 500 API automation tests using SpecFlow with CSharp (and Visual Studio).
Sometimes the API tests run very rapidly (taking the expected few seconds to run). However, other times some of them will randomly hang and take 10 minutes or longer to run. I have looked at the 'Output' pane and selected 'Tests', but nothing shows up while the tests are hanging. Can anyone recommend a good way of debugging these hanging tests?
Note: I do not have any 'wait' aspects in my tests except 'await' for the API responses.
Upvotes: 0
Views: 637
Reputation: 4594
After using Fiddler to debug the issue, I noticed the API requests were never being sent. Turned out it was accessing the Database in the test setup that was causing the issue. I was returning all values in a table and then filtering, rather than requesting a filtered set of data. Oops! Hope this response saves someone else some time in the future. If slow tests, debug line by line and work out the exact section that is slowing things down.
Upvotes: 1