AI ECA: Fix the random test failure on ChatTest
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3499900. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !418
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Maybe one time out of 10 or 20 or so there is a reoccuring test failure, that can be fixed by rerunning the test.</p>
<p>Its always in PHPCS (previous major) with the following:</p>
<pre>---- Drupal\Tests\ai_eca\Kernel\Plugin\Action\ChatTest ----<br>Status Group Filename Line Function <br>--------------------------------------------------------------------------------<br>Fail Other phpunit-3.xml 0 Drupal\Tests\ai_eca\Kernel\Plugin\A<br> PHPUnit Test failed to complete; Error: PHPUnit 9.6.22 by Sebastian<br> Bergmann and contributors.<br> <br> Testing Drupal\Tests\ai_eca\Kernel\Plugin\Action\ChatTest<br> ..F. 4 / 4<br> (100%)<br> <br> Time: 00:04.422, Memory: 12.00 MB<br> <br> There was 1 failure:<br> <br> 1) Drupal\Tests\ai_eca\Kernel\Plugin\Action\ChatTest::testWithoutInput<br> Failed asserting that 'Hello world! Input: GtHM>&{" My AI/ECA site<br> n6d56i93: 'KO"''>&b('\n<br> . Config: [].' contains "KO"'>&b(".<br> <br> /builds/project/ai/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122<br> /builds/project/ai/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:56<br> /builds/project/ai/modules/ai_eca/tests/src/Kernel/Plugin/Action/ChatTest.php:124<br> /builds/project/ai/vendor/phpunit/phpunit/src/Framework/TestResult.php:729<br> <br> FAILURES!<br> Tests: 4, Assertions: 31, Failures: 1.<br>---- Drupal\Tests\ai\Kernel\OperationType\Chat\ChatInterfaceTest ----</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Figure out why it is failing randomly.<br>
Fix it.</p>
issue