[Testbox 4.5.0+5] Timeout When Executing All Tests

I’ve got a lot of tests, and from what I hear, that’s a good thing! However, whenever I try to execute all of my integration tests at once via tests/index.cfm?action=runTestBox&path=%2Fintegration, I get a timeout exception after ~2 minutes:

The request has exceeded the allowable time limit Tag: CFQUERY
The error occurred in /testbox/system/coverage/stats/CoverageStats.cfc: line 31

I’ve tried a few different things to resolve the issue:

  1. I modified /tests/application.cfc to force coverageEnabled to false, and increasing the requesttimeout to an extremely high value.
url.coverageEnabled = false;
setting requesttimeout=9000; 

Unfortunately, this appears to have no effect.

  1. I tried messing with the guts of /testbox/system/TestBox.cfc and commented out references to coverageService.
    The only change that occurs after doing that is that the timeout exception occurs after ~5 minutes and changes to:

The request has exceeded the allowable time limit Tag: cfoutput
The error occurred in /testbox/system/reports/assets/simple.cfm: line 3

If I run my tests one by one, everything works great, but it’s a pain because there are a lot of test files to execute. Is there a way I can extend the timeout of Testbox so I can run them all at once?

I figured it out. I had setting requestTimeout=xxxx in one of my handlers which resets the timeout.

I solved the problem by extending the timeout using this handy function:

function extendTimeout( required numeric seconds ) {
        var monitor = createObject("java", "coldfusion.runtime.RequestMonitor");
        setting requesttimeout = ( monitor.getRequestTimeout()+arguments.seconds );

Maybe I’ll make this into a Forgebox module if it doesn’t already exist and if it would help out anyone else.