kwin upstream commit 54b69bec4 "Honor BUILD_TESTING" fixed the problem (at least for no-testing, confirmed by commenting the patch line in the ebuild) and the gentoo/kde-level 5.10.95-test-optional patch no longer applies.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/kde.git/commit/?id=3e7a4ed7932d8eec16081cf7ee88f370f6dbc79d commit 3e7a4ed7932d8eec16081cf7ee88f370f6dbc79d Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2018-06-01 18:22:04 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2018-06-01 18:22:48 +0000 kde-plasma/kwin: Patch upstreamed (kinda) Closes: https://bugs.gentoo.org/657024 Package-Manager: Portage-2.3.40, Repoman-2.3.9 kde-plasma/kwin/kwin-9999.ebuild | 2 -- 1 file changed, 2 deletions(-)