Skip to content

Commit

Permalink
Use 5m update-status hook interval for the auth test (#387)
Browse files Browse the repository at this point in the history
* Use 5m update-status hook interval for the auth test

* Fix typo

* Increase retry count
  • Loading branch information
sed-i authored Jul 30, 2024
1 parent f131f2a commit b48489a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/integration/test_forward_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ async def test_deployment(ops_test: OpsTest, traefik_charm, forward_auth_tester_

await ops_test.model.integrate(f"{TRAEFIK_CHARM}:experimental-forward-auth", OATHKEEPER_CHARM)

# The auth lib uses event deferral, so by extension it depends on the update-status hook.
# As a result, when we use our 60m interval from the autouse fixture, test occasionally fail.
# Here we override the interval just for this test.
await ops_test.model.set_config({"update-status-hook-interval": "5m"})

await ops_test.model.wait_for_idle(
[TRAEFIK_CHARM, OATHKEEPER_CHARM, IAP_REQUIRER_CHARM], status="active", timeout=1000
)


@retry(
wait=wait_exponential(multiplier=3, min=1, max=20),
stop=stop_after_attempt(20),
wait=wait_exponential(multiplier=3, min=1, max=30),
stop=stop_after_attempt(30),
reraise=True,
)
async def test_allowed_forward_auth_url_redirect(ops_test: OpsTest) -> None:
Expand Down Expand Up @@ -136,8 +141,8 @@ async def test_forward_auth_url_response_headers(


@retry(
wait=wait_exponential(multiplier=3, min=1, max=20),
stop=stop_after_attempt(20),
wait=wait_exponential(multiplier=3, min=1, max=30),
stop=stop_after_attempt(30),
reraise=True,
)
def assert_anonymous_response(url):
Expand Down

0 comments on commit b48489a

Please sign in to comment.