Problem/Motivation

In #3278493: Make it easier for theme builders to enable Twig debugging and disable render cache I discovered that state is broken when using a memory backend. That's because the service is initialized and the persisted service is not set.

#2368263: Remove the persist service tag tries to remove the persist tag completely. However, a good bug fix exists by replacing how KernelTestBase ensures the memory backend for state persists.

Steps to reproduce

Proposed resolution

Fix how KernelTestBase persists the key value store

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#13 3358048-13.patch1.58 KBdww

Issue fork drupal-3358048

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review

The KernelTestBase fix was first introduced in #2368263-35: Remove the persist service tag by amateescu

dww credited amateescu.

dww’s picture

Issue tags: +Bug Smash Initiative

Nice, thanks! Per #3 crediting @amateescu.

The MR is small, simple, and well-documented. Curious to see if the bot has any problems with this. So far, looks RTBC to me.

Thanks again,
-Derek

dww’s picture

Status: Needs review » Reviewed & tested by the community

Nothing to object to in the code. The issue title and summary are clear. This doesn't need a change record, since no one needs to know or care that this implementation detail is different. Ditto a release note. Bot is happy, so am I. 😉 Ship it!

Thanks!
-Derek

dww’s picture

I don't think we need explicit test coverage of this change. I asked about it in #bugsmash and @catch replied:

If the patch from the other issue fails without it that can count as test coverage, I didn't check if that's the case.

So I tried a combined patch over there. We went from 27 fails with the patch at comment #3278493-95: Make it easier for theme builders to enable Twig debugging and disable render cache to only 1 fail by also applying this patch at comment #98. That seems like sufficient improvement to know this is what we need. 😅🙏

Cheers,
-Derek

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed e129b1e and pushed to 10.1.x. Thanks!

  • catch committed e129b1e0 on 10.1.x
    Issue #3358048 by mglaman, dww, amateescu: Do not use persist tag for...
catch’s picture

dww’s picture

Thanks!

Is this back-port-able?

I’m having trouble imagining how the new approach could cause any disruption. It seems obviously more reliable and better for making sure the key value survives. Anyone relying on key value getting clobbered on a container build seems like they have buggy tests and should fix them. 😉

longwave’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Fixed » Patch (to be ported)

If we get a green test run on 10.0.x/9.5.x I don't see an issue with backporting it, given this is tests-only and only likely to fix problems rather than cause them.

Will need new MRs or a patch uploading to test on the other branches.

dww’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.58 KB

Here's exactly the MR diff in patch form, which I just checked applies cleanly to both 9.5.x and 10.0.x branches.

dww’s picture

Status: Needs review » Reviewed & tested by the community

Bot is green on both branches. Cherry-pick away. 😅

  • longwave committed b20bccfd on 10.0.x authored by catch
    Issue #3358048 by mglaman, dww, amateescu: Do not use persist tag for...

  • longwave committed 50450028 on 9.5.x authored by catch
    Issue #3358048 by mglaman, dww, amateescu: Do not use persist tag for...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Cherry-picked and pushed to 10.0.x and 9.5.x, thanks!

andypost’s picture

Status: Fixed » Needs work

backport to 9.5 needs revert and new patch without type for property https://www.drupal.org/pift-ci-job/2663367

andypost’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.