Skip to content

Commit

Permalink
Migrate away the unmaintained Flaky library.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Mar 4, 2024
1 parent 41d0754 commit df2be22
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/integration/deployment/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd -
# FIXME: Install correct version of metal_python
pip install --root-user-action=ignore --upgrade pip \
coverage \
flaky \
pytest-rerunfailures \
mock \
metal_python \
pytest \
Expand Down
8 changes: 0 additions & 8 deletions test/integration/deployment/test/common.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import time
import unittest

class FlakyBackoff:
def __init__(self, backoff_seconds=1):
self._backoff_seconds = backoff_seconds

def backoff(self, *args):
time.sleep(self._backoff_seconds)
return True


class TestinfraCommon(unittest.TestCase):
def service_enabled_and_running(self, host, service_name):
Expand Down
4 changes: 2 additions & 2 deletions test/integration/deployment/test/deployment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from kubernetes import client, config
import metal_python.api as metal_api
from metal_python.driver import Driver
from flaky import flaky
import pytest
import testinfra

import common
Expand Down Expand Up @@ -48,7 +48,7 @@ def test_api_is_healthy(self):
self.assertEqual(res.status, "healthy")
self.assertEqual(res.message, "")

@flaky(max_runs=36, rerun_filter=common.FlakyBackoff(10).backoff)
@pytest.mark.flaky(reruns=36, reruns_delay=10)
def test_switches_have_registered(self):
api = metal_api.SwitchApi(api_client=self.driver.client)
try:
Expand Down

0 comments on commit df2be22

Please sign in to comment.