AI Search tests is failing on next minor

Created on 1 September 2025, 3 days ago

Problem/Motivation

Currently PHPUnit next minor is failing with the following issue

    Ai Search Setup My Sql (Drupal\Tests\ai_search\Functional\AiSearchSetupMySql)
     ✘ Field indexing options
       ┐
       ├ Behat\Mink\Exception\ResponseTextException: The text "[Chocolate Cake](/web/node/1)" was not found anywhere in the text of the current page.
       │
       │ /builds/project/ai/vendor/behat/mink/src/WebAssert.php:907
       │ /builds/project/ai/vendor/behat/mink/src/WebAssert.php:293
       │ /builds/project/ai/web/core/tests/Drupal/Tests/WebAssert.php:981
       │ /builds/project/ai/modules/ai_search/tests/src/Functional/AiSearchSetupMySqlTest.php:234
       ┴
     ✘ Search view
       ┐
       ├ Row 1 contains "cake".                                                   
       ├ Failed asserting that 'Member for 0 seconds Submitted by ch6a6ed3 on Mon, 1 Sep 2025 - 17:08 gpwhoy2d7tne6o0rppnexhjosiaw1u8u' [ASCII](length: 102) contains "Strawberry Cheese Cake" [ASCII](length: 22).
       │
       │ /builds/project/ai/modules/ai_search/tests/src/Functional/AiSearchSetupMySqlTest.php:320

We need to verify if this is a real issue or a testing issue before Drupal 11.3 is released.

Proposed resolution

Try to replicate the error using a setup with Drupal 11.3
If not, try to figure out what is failing in the test.

🐛 Bug report
Status

Active

Version

1.2

Component

AI Search

Created by

🇩🇪Germany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marcus_johansson
  • 🇬🇧United Kingdom littlepixiez

    It is failing here:

    $this->assertSession()->pageTextContains('[Chocolate Cake](' . $this->nodes[0]->toUrl()->toString() . ')');
    

    However, in Drupal 11.2, this is how the markup appears:

    And in Drupal 11.3, this is how the markup appears:

    I can't quite figure out where Drupal core has made a change that is effecting this. The actual value is missing completely, so the rendered item in 11.2 is:

    <article>
    
      
          <h2>
          <a href="/node/1" rel="bookmark">
    <span>Chocolate Cake</span>
    </a>
        </h2>
        
    
          <footer>
          <article>
      <div class="js-form-item form-item js-form-type-item form-item- js-form-item- form-no-label">
            <h4 class="label">Member for</h4> 0 seconds
            </div>
    </article>
    
          <div>
            Submitted by 
    <span><span>ct7lb84o</span></span>
     on 
    <span><time datetime="2025-09-02T07:29:43+10:00" title="Tuesday, 2 September 2025 - 07:29">Tue, 2 Sep 2025 - 07:29</time>
    </span>
          </div>
        </footer>
      
      <div>
        
                <div><p>d53u1fapp20u9xclhptuqr7cm83p5cp5</p>
    </div>
          
      </div>
    
    </article>

    And the rendered item in 11.3 is:

    
    <article>
    
      
        
    
          <footer>
          <article>
      <div class="js-form-item form-item form-type-item js-form-type-item form-item- js-form-item- form-no-label">
            <h4 class="label">Member for</h4> 0 seconds
            </div>
    </article>
    
          <div>
            Submitted by 
    <span><span>uxwhrmlz</span></span>
     on 
    <span><time datetime="2025-09-02T07:31:11+10:00" title="Tuesday, 2 September 2025 - 07:31">Tue, 2 Sep 2025 - 07:31</time>
    </span>
          </div>
        </footer>
      
      <div>
        
                <div><p>vhzxyxa8xnq3kfrlsbpgsblz1sme4xza</p>
    </div>
          
      </div>
    
    </article>
    
    
    

    So it is stripping out the H2 completely. I'll have more of a dig when I get time - perhaps somebody can glance at this and have an "aha" moment!

    Depending on how much we "need" this to be correct, we could just add in a conditional or just check for the title? Dependant on this module's need for the check. I can't see anything that's "breaking" this, but I'd need some more time to dig in.

  • 🇪🇸Spain gxleano Cáceres
Production build 0.71.5 2024