For me, the problem was that this can be set in two places. I was looking at the "stop the task if it runs longer than" setting on the Settings tab of the task properties. There is also the same setting in the details of each item in the Triggers tab.
I had disabled the stop in the Settings tab, but not in the Triggers tab, so it was terminating it. Once I disabled it in both places, it worked as expected.