Skip to content

ci: fix docker cache fail - #26922

Merged
BeryJu merged 1 commit into
mainfrom
ci/fix-docker-cache-fai
Oct 14, 2026
Merged

BeryJu merged 1 commit into
mainfrom
ci/fix-docker-cache-fai

Conversation

@BeryJu

@BeryJu BeryJu commented Oct 14, 2026

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Jens Langhammer <[email protected]>
@BeryJu
BeryJu requested a review from a team as a code owner October 14, 2026 17:19
@netlify

netlify Bot commented Oct 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit aae0ee2
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6acfb9bbdf033431b56d8d2b
😎 Deploy Preview https://deploy-preview-26922--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
4685 7 4678 14
View the full list of 7 ❄️ flaky test(s)
authentik.core.tests.test_application_pagination.TestApplicationPaginationCost::test_filtering_cost

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 0.506s run time
self = <unittest.case._Outcome object at 0x703cf2c0cc20>
test_case = <authentik.core.tests.test_application_pagination.TestApplicationPaginationCost testMethod=test_filtering_cost>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7........./x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestApplicationPaginationCost testMethod=test_filtering_cost>
result = <TestCaseFunction test_filtering_cost>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.7........./x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestApplicationPaginationCost testMethod=test_filtering_cost>
method = <bound method TestApplicationPaginationCost.test_filtering_cost of <authentik.core.tests.test_application_pagination.TestApplicationPaginationCost testMethod=test_filtering_cost>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.7........./x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestApplicationPaginationCost testMethod=test_filtering_cost>

    def test_filtering_cost(self):
        """Expose full-set evaluation costs and guard against static-binding N+1 queries."""
        admin = create_test_admin_user()
        user = create_test_user()
        policy = ExpressionPolicy.objects.create(
            name="pagination-cost",
            expression="return int(request.obj.slug.split('-')[-1]) % 10 == 0",
        )
        apps = []
        print("\napps policy cache pipeline median_ms queries policy_executions")
        for size in (20, 140, 1000):
            for index in range(len(apps), size):
                apps.append(
                    Application.objects.create(name=f"app-{index:04d}", slug=f"app-{index:04d}")
                )
            for dynamic in (False, True):
                PolicyBinding.objects.filter(target__in=apps).delete()
                PolicyBinding.objects.bulk_create(
                    [
                        PolicyBinding(
                            target=app,
                            policy=policy if dynamic else None,
                            user=None if dynamic else (user if index % 10 == 0 else admin),
                            order=0,
                        )
                        for index, app in enumerate(apps)
                    ]
                )
                for warm in (False, True) if dynamic else (False,):
                    for full_set in (False, True):
                        durations, queries, executions = [], [], []
                        for _ in range(3):
                            cache.delete_many(cache.keys(f"{CACHE_PREFIX}*"))
                            if warm:
                                self._run_pipeline(admin, user, full_set)
                            with (
                                CaptureQueriesContext(connection) as captured,
                                patch.object(
                                    ExpressionPolicy,
                                    "passes",
                                    autospec=True,
                                    side_effect=ExpressionPolicy.passes,
                                ) as passes,
                            ):
                                start = perf_counter()
>                               response = self._run_pipeline(admin, user, full_set)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.../core/tests/test_application_pagination.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestApplicationPaginationCost testMethod=test_filtering_cost>
admin = <User: AHCHJIEr9GxjB0hHwO8S>, user = <User: ZtPsq1lOXGrnFqLWaazG>
full_set = False

    def _run_pipeline(self, admin, user, full_set):
        """Reproduce each pipeline with fresh querysets and identical page size/serialization."""
        raw_request = APIRequestFactory().get("/", {"page_size": 20, "for_user": user.pk})
        force_authenticate(raw_request, user=admin)
        view = ApplicationViewSet()
        view.action_map = {"get": "list"}
        view.request = view.initialize_request(raw_request)
        view.format_kwarg = None
>       queryset = view._filter_queryset_for_list(view.get_queryset()).exclude(meta_hide=True)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'ApplicationViewSet' object has no attribute '_filter_queryset_for_list'

.../core/tests/test_application_pagination.py:237: AttributeError
authentik.core.tests.test_application_pagination.TestUserApplicationPagination::test_empty

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 1.03s run time
self = <unittest.case._Outcome object at 0x703cf2c0e970>
test_case = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>
result = <TestCaseFunction test_empty>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>
method = <bound method TestUserApplicationPagination.test_empty of <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>

    def test_empty(self):
        """A user with no access gets an empty first page with a zero count."""
        response = self.client.get(self.url, {"for_user": create_test_user().pk, "page_size": 2})
        self.assertEqual(response.status_code, 200)
>       self.assertEqual(response.data["results"], [])

.../core/tests/test_application_pagination.py:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>
first = [{'pk': 'fed651b2-eab2-411f-8af5-f703da4fe46c', 'pbm_uuid': 'fed651b2-eab2-411f-8af5-f703da4fe46c', 'name': 'app-0', '...ls': None, 'meta_description': '', 'meta_publisher': '', 'policy_engine_mode': 'any', 'group': '', 'meta_hide': False}]
second = [], msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_empty>
first = [{'pk': 'fed651b2-eab2-411f-8af5-f703da4fe46c', 'pbm_uuid': 'fed651b2-eab2-411f-8af5-f703da4fe46c', 'name': 'app-0', '...ls': None, 'meta_description': '', 'meta_publisher': '', 'policy_engine_mode': 'any', 'group': '', 'meta_hide': False}]
second = []
msg = "[{'pk': 'fed651b2-eab2-411f-8af5-f703da4fe[921 chars]lse}] != []"

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: [{'pk': 'fed651b2-eab2-411f-8af5-f703da4fe[921 chars]lse}] != []

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:918: AssertionError
authentik.core.tests.test_application_pagination.TestUserApplicationPagination::test_expression_uses_target_user

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 0.948s run time
self = <unittest.case._Outcome object at 0x703cf2c0eac0>
test_case = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>
result = <TestCaseFunction test_expression_uses_target_user>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>
method = <bound method TestUserApplicationPagination.test_expression_uses_target_user of <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>

    def test_expression_uses_target_user(self):
        """Dynamic policies also evaluate as the target user, including HTTP request context."""
        PolicyBinding.objects.all().delete()
        policy = ExpressionPolicy.objects.create(
            name="target-user",
            expression=(
                f"return request.user.pk == {self.user.pk} "
                f"and request.http_request.user.pk == {self.user.pk} "
                "and request.obj.slug in ('app-3', 'app-5')"
            ),
        )
        for app in self.apps:
            PolicyBinding.objects.create(target=app, policy=policy, order=0)
        response = self.client.get(self.url, {"for_user": self.user.pk, "page_size": 2})
        self.assertEqual(response.status_code, 200)
>       self.assertEqual(response.data["pagination"]["count"], 2)

.../core/tests/test_application_pagination.py:122: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>
first = 7, second = 2, msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_expression_uses_target_user>
first = 7, second = 2, msg = '7 != 2'

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: 7 != 2

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:918: AssertionError
authentik.core.tests.test_application_pagination.TestUserApplicationPagination::test_filters_and_ordering

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 0.76s run time
self = <unittest.case._Outcome object at 0x703cf2d018d0>
test_case = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>
result = <TestCaseFunction test_filters_and_ordering>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>
method = <bound method TestUserApplicationPagination.test_filters_and_ordering of <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>

    def test_filters_and_ordering(self):
        """Hidden objects and search filters are excluded; ordering survives policy filtering."""
        self.apps[3].meta_hide = True
        self.apps[3].save()
        response = self.client.get(
            self.url,
            {"for_user": self.user.pk, "page_size": 1, "ordering": "-name", "search": "app"},
        )
        self.assertEqual(response.status_code, 200)
>       self.assertEqual(response.data["pagination"]["count"], 2)

.../core/tests/test_application_pagination.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>
first = 7, second = 2, msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_filters_and_ordering>
first = 7, second = 2, msg = '7 != 2'

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: 7 != 2

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:918: AssertionError
authentik.core.tests.test_application_pagination.TestUserApplicationPagination::test_invalid_target

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 1.22s run time
self = <unittest.case._Outcome object at 0x703cf2d023c0>
test_case = <unittest.case._SubTest testMethod=runTest>, subTest = True

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7............/x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_invalid_target>
msg = <object object at 0x703d1a383a70>, params = {'target': -1}

    @contextlib.contextmanager
    def subTest(self, msg=_subtest_msg_sentinel, **params):
        """Return a context manager that will return the enclosed block
        of code in a subtest identified by the optional message and
        keyword parameters.  A failure in the subtest marks the test
        case as failed but resumes execution at the end of the enclosed
        block, allowing further test code to be executed.
        """
        if self._outcome is None or not self._outcome.result_supports_subtests:
            yield
            return
        parent = self._subtest
        if parent is None:
            params_map = _OrderedChainMap(params)
        else:
            params_map = parent.params.new_child(params)
        self._subtest = _SubTest(self, msg, params_map)
        try:
            with self._outcome.testPartExecutor(self._subtest, subTest=True):
>               yield

.../hostedtoolcache/Python/3.14.7............/x64/lib/python3.14/unittest/case.py:565: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_invalid_target>

    def test_invalid_target(self):
        """Malformed and nonexistent user IDs still fail validation."""
        for target in ("invalid", -1):
            with self.subTest(target=target):
                response = self.client.get(self.url, {"for_user": target})
>               self.assertEqual(response.status_code, 400)

.../core/tests/test_application_pagination.py:130: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_invalid_target>
first = 200, second = 400, msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.14.7............/x64/lib/python3.14/unittest/case.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_invalid_target>
first = 200, second = 400, msg = '200 != 400'

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: 200 != 400

.../hostedtoolcache/Python/3.14.7............/x64/lib/python3.14/unittest/case.py:918: AssertionError
authentik.core.tests.test_application_pagination.TestUserApplicationPagination::test_pages

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 1.45s run time
self = <unittest.case._Outcome object at 0x703cf2d012b0>
test_case = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>
result = <TestCaseFunction test_pages>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>
method = <bound method TestUserApplicationPagination.test_pages of <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>

    def test_pages(self):
        """Denied objects must not consume slots or inflate any pagination metadata."""
        for page, indices, expected_pagination in (
            (
                1,
                [1, 3],
                dict(
                    next=2,
                    previous=0,
                    count=3,
                    current=1,
                    total_pages=2,
                    start_index=1,
                    end_index=2,
                ),
            ),
            (
                2,
                [5],
                dict(
                    next=0,
                    previous=1,
                    count=3,
                    current=2,
                    total_pages=2,
                    start_index=3,
                    end_index=3,
                ),
            ),
        ):
            with self.subTest(page=page):
                response = self.client.get(
                    self.url, {"for_user": self.user.pk, "page_size": 2, "page": page}
                )
                self.assertEqual(response.status_code, 200)
                self.assertEqual(response.data["pagination"], expected_pagination)
                self.assertEqual(
                    [app["slug"] for app in response.data["results"]],
                    [self.apps[index].slug for index in indices],
                )
        response = self.client.get(self.url, {"for_user": self.user.pk, "page_size": 2, "page": 3})
>       self.assertEqual(response.status_code, 404)

.../core/tests/test_application_pagination.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>
first = 200, second = 404, msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_pages>
first = 200, second = 404, msg = '200 != 404'

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: 200 != 404

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:918: AssertionError
authentik.core.tests.test_application_pagination.TestUserApplicationPagination::test_requires_user_applications_permission

Flake rate in main: 100.00% (Passed 0 times, Failed 86 times)

Stack Traces | 0.699s run time
self = <unittest.case._Outcome object at 0x703cf2d011d0>
test_case = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>
result = <TestCaseFunction test_requires_user_applications_permission>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>
method = <bound method TestUserApplicationPagination.test_requires_user_applications_permission of <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>

    def test_requires_user_applications_permission(self):
        """An unprivileged caller cannot list another user's applications."""
        self.client.force_login(self.user)
        response = self.client.get(self.url, {"for_user": self.admin.pk})
>       self.assertEqual(response.status_code, 400)

.../core/tests/test_application_pagination.py:136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>
first = 403, second = 400, msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_application_pagination.TestUserApplicationPagination testMethod=test_requires_user_applications_permission>
first = 403, second = 400, msg = '403 != 400'

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: 403 != 400

.../hostedtoolcache/Python/3.14.7.............../x64/lib/python3.14/unittest/case.py:918: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@BeryJu
BeryJu merged commit 17f85f4 into main Oct 14, 2026
132 of 138 checks passed
@BeryJu
BeryJu deleted the ci/fix-docker-cache-fai branch October 14, 2026 17:33
@github-actions

Copy link
Copy Markdown
Contributor

Playwright e2e

Download this run's HTML report and traces, then open the report:

gh run download 38605746862 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-report

@emilburzo emilburzo added backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 labels Nov 3, 2026
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

⚠️ Cherry-pick to version-2026.5 has conflicts: #27480

@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #27481

emilburzo pushed a commit that referenced this pull request Nov 3, 2026
)

ci: fix docker cache fail (#26922)

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens L. <[email protected]>
emilburzo added a commit that referenced this pull request Nov 3, 2026
)

* Cherry-pick #26922 to version-2026.5 (with conflicts)

This cherry-pick has conflicts that need manual resolution.

Original PR: #26922
Original commit: 17f85f4

* Update .github/actions/setup/action.yml

Signed-off-by: Emil Burzo <[email protected]>

---------

Signed-off-by: Emil Burzo <[email protected]>
Co-authored-by: Jens L. <[email protected]>
Co-authored-by: Emil Burzo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants