Possible testing bugs with RequestTrait and a growing request stack

Created on 19 March 2025, 16 days ago

Overview

We added RequestTrait off of some example code I have in various projects. I just encountered a quirky little bug where the request stack is wrong and may have too many requests due to:

- \Drupal\KernelTests\KernelTestBase::bootKernel() pushes a bogus request to boot the kernel, but it is also needed for any URL generation in tests to work, so it cannot be popped immediately.
- All requests keep getting pushed and we don't want to pop after a request is made so the test can do work

Proposed resolution

Before making a request, clear the request stack

User interface changes

None, test only.

πŸ› Bug report
Status

Active

Version

0.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024