views:

50

answers:

0

I was having a really odd problem in my cucumber tests that was causing scenarios that were passing individually, to fail when run with others in a feature. I deduced this was a MySQL related issue and sure enough, a co-worker came along and recommended I change my connection pool to a higher value in my database config. Lo' and behold, it worked. As happy as I was to solve this problem, I can't see why Cucumber would be keeping all of these connections alive simultaneously. As I see it, it should either keep one connection for the whole feature, or disconnect old scenarios when starting the next.

If this is indeed a bug, how would you go about forcing the MySQL disconnect between scenarious in Cucumber?

Edit: The issue is not with Cucumber (I know, I know, it's always user error). I'm using multi-threading to simulate user input in a stubbed out RAGI handler. I realized I wasn't killing my threads at the end of the step and they weren't dying because I was only testing the first half of the handler. They were left hanging and therefore, the MySQL connections were too. I added a step called hang_up that exits the thread from cucumber and now I can set my pool back to a reasonable number.