Skip to content

Test server crash #20944

Open
Open

Description

@ashik-ts-12418

🐞 Describe the Bug

When using partial string interpolation inside a style attribute (e.g. style="border: 3px solid {{this.borderColor}}") inside an {{#each}} block, the test suite hangs and CPU usage spikes to 100%—but only during testing (ember test --server). This issue becomes worse when multiple tests visit the same page repeatedly, as each visit seems to increase memory or DOM processing load.

This issue does not occur in the browser and happens even if the bound values are static or never change.
(may be because the app doesn't render again and again such as tests)


🔬 Minimal Reproduction

Tested even in Ember’s official Super Rentals example.
https://github.com/ember-learn/super-rentals/tree/super-rentals-tutorial-output

Controller:

export default class IndexController {
  arrayOfNames = [
    'apple white', 'aqua', 'aqua marine', 'bisque', 'black',
    'blanched almond', 'blue', 'blue violet', 'brown', 'chocolate',
    'crimson red', 'cyan', 'dark blue', 'dark cyan', 'dark green',
    'fire brick', 'floral white', 'ghost white', 'grey', 'yellow green'
  ];

  borderColor = 'red';
}

Template:

<ul>
  {{#each this.arrayOfNames as |name|}}
    <li style="border: 3px solid {{this.borderColor}}">{{name}}</li>
  {{/each}}
</ul>

Acceptance Test:

module('Acceptance | repeated visit', function(hooks) {
  setupApplicationTest(hooks);

  test('checking all li elements are present', async function (assert) {
    await visit('/');
    assert.dom('li').exists({ count: 20 });
  });

  test('checking li element - apple white', async function (assert) {
    await visit('/');
    assert.dom('li').containsText('apple white');
  });

  test('checking li element - aqua', async function (assert) {
    await visit('/');
    assert.dom('li').containsText('aqua');
  });

  // ... similar tests for remaining items
});

Run using:

ember test --server

😕 Actual Behavior

  • Test server hangs after several test cases.
  • CPU usage spikes to 100%.
  • Manual kill required (Ctrl+C may not respond).
  • More repeated renders = faster hangs.

🤔 Expected Behavior

  • CPU and memory usage should remain stable.
  • Static style interpolations should not trigger test instability.

🌍 Environment

{
  "ember": "6.4.0",
  "ember-cli": "~6.4.0",
  "ember-qunit": "^9.0.2",
  "node": "22.12.0",
  "yarn": "1.22.10",
  "os": "macOS 15.5 (Intel + M1 tested)",
  "volta": {
    "node": "22.12.0",
    "yarn": "1.22.10"
  }
}

➕ Additional Context

  • Rewriting the style like this avoids the issue:

    <li style="{{this.computedStyle}}"> <!-- returns 'border: 3px solid red' -->

Example:
https://stackblitz.com/edit/github-yu36hthb?file=tests%2Facceptance%2Findex-test.js

You can run ember t -s in this app to replicate this issue

screen shot:

Image

Activity

  1. NullVoxPopuli commented on Jul 8, 2025

    @NullVoxPopuli
    SponsorContributor

    is something wrong with the repro?

    Image

    i get this in the stackblitz

  2. ashik-ts-12418 commented on Jul 8, 2025

    @ashik-ts-12418
    Author

    Sorry about that — I’ve fixed it now.

    The test may still fail, but please check whether the server hangs while running it.
    It’s a good idea to monitor your CPU usage in Activity Monitor during the test run.

  3. ashik-ts-12418 commented on Jul 9, 2025

    @ashik-ts-12418
    Author

    @NullVoxPopuli after all the tests have finished, click 'Go' again—you’ll notice that the test service shuts down.

  4. kategengler commented on Sep 1, 2025

    @kategengler
    Member

    You're saying this doesn't happen when running tests via localhost:4200/tests?

  5. ashik-ts-12418 commented on Sep 2, 2025

    @ashik-ts-12418
    Author

    No, the server crashes anyway.
    The issue appears to be an out-of-memory error triggered when an element’s style attribute contains a value with partial string interpolation such as:
    <li style="border: 3px solid {{this.borderColor}}">{{this.name}}</li>

  6. NullVoxPopuli commented on May 6, 2026

    @NullVoxPopuli
    SponsorContributor

    and out of memory error?

    what are your NODE_OPTIONS?

    echo $NODE_OPTIONS
  7. ashik-ts-12418 commented on May 7, 2026

    @ashik-ts-12418
    Author

    Nothing. I don't have any node options.

    echo $NODE_OPTIONS -> ''

  8. kategengler commented on Jun 22, 2026

    @kategengler
    Member

    I missed this the first time I read through this issue:

    <ul>
      {{#each this.arrayOfNames as |name|}}
        <li style="border: 3px solid {{this.borderColor}}">{{name}}</li>
      {{/each}}
    </ul>
    

    This code should generate a warning on the console about the potential for XSS when binding style attributes. Potentially that is causing the leak you are seeing?

    Either way, styles should be put in a getter and marked as trustHTML, if you do in fact trust what you are binding.

  9. NullVoxPopuli commented on Jul 26, 2026

    @NullVoxPopuli
    SponsorContributor

    @ashik-ts-12418 is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions