'Codeception test returning [Facebook\WebDriver\Exception\UnknownErrorException] InternalError: too much recursion

Test fails with [Facebook\WebDriver\Exception\UnknownErrorException] InternalError: too much recursion when trying to execute $I->see() on a specific piece of text.

When analyzing the source code I see there's 250k lines of HTML code, so it's causing some sort of a bottle neck. I was wondering if there's a way to identify this issue without having the whole test fail?

I tried wrapping it in try/catch, but it didn't help.

enter image description here

UPDATE

Browser: Geckodriver
Version: Codeception PHP Testing Framework v2.5.6

Code

        try {
            $this->see($text);
            $isFound = true;
        } catch (\PHPUnit_Framework_ExpectationFailedException $e) {
            $isFound = false;
        }


Solution 1:[1]

updated codeception 2.5.6 which is 3 yrs old and it fixed the issue. markup was over 10mb per page which is abnormally high.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Robert Sinclair