From 6e5ad60ceadab261876cd4d5e5c5825fb268492f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 27 Jan 2023 17:59:38 +0100 Subject: [PATCH] tests: retry on correct LDAP exceptions for samba tests Signed-off-by: Jens Langhammer --- tests/e2e/test_source_ldap_samba.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/test_source_ldap_samba.py b/tests/e2e/test_source_ldap_samba.py index cff8feae3..3b3d7f9bf 100644 --- a/tests/e2e/test_source_ldap_samba.py +++ b/tests/e2e/test_source_ldap_samba.py @@ -2,6 +2,7 @@ from typing import Any, Optional from django.db.models import Q +from ldap3.core.exceptions import LDAPSessionTerminatedByServerError from authentik.blueprints.tests import apply_blueprint from authentik.core.models import Group, User @@ -37,7 +38,7 @@ class TestSourceLDAPSamba(SeleniumTestCase): }, } - @retry() + @retry(exceptions=[LDAPSessionTerminatedByServerError]) @apply_blueprint( "system/sources-ldap.yaml", ) @@ -68,7 +69,7 @@ class TestSourceLDAPSamba(SeleniumTestCase): self.assertTrue(User.objects.filter(username="john").exists()) self.assertTrue(User.objects.filter(username="harry").exists()) - @retry() + @retry(exceptions=[LDAPSessionTerminatedByServerError]) @apply_blueprint( "system/sources-ldap.yaml", ) @@ -111,7 +112,7 @@ class TestSourceLDAPSamba(SeleniumTestCase): ) self.assertEqual(list(User.objects.get(username="harry").ak_groups.all()), []) - @retry() + @retry(exceptions=[LDAPSessionTerminatedByServerError]) @apply_blueprint( "system/sources-ldap.yaml", )