mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-15 19:38:11 +00:00
Working in retry to test endpoint during integration test. (#1565)
This commit is contained in:
committed by
GitHub
parent
af684f1335
commit
d358938895
@ -223,6 +223,7 @@ TARGETS: Dict[str, Integration] = {
|
|||||||
|
|
||||||
OperationResult = TypeVar("OperationResult")
|
OperationResult = TypeVar("OperationResult")
|
||||||
|
|
||||||
|
|
||||||
def retry(
|
def retry(
|
||||||
operation: Callable[[Any], OperationResult],
|
operation: Callable[[Any], OperationResult],
|
||||||
description: str,
|
description: str,
|
||||||
@ -251,6 +252,7 @@ def retry(
|
|||||||
)
|
)
|
||||||
time.sleep(wait_duration)
|
time.sleep(wait_duration)
|
||||||
|
|
||||||
|
|
||||||
class TestOnefuzz:
|
class TestOnefuzz:
|
||||||
def __init__(self, onefuzz: Onefuzz, logger: logging.Logger, test_id: UUID) -> None:
|
def __init__(self, onefuzz: Onefuzz, logger: logging.Logger, test_id: UUID) -> None:
|
||||||
self.of = onefuzz
|
self.of = onefuzz
|
||||||
@ -268,6 +270,11 @@ class TestOnefuzz:
|
|||||||
pool_size: int,
|
pool_size: int,
|
||||||
os_list: List[OS],
|
os_list: List[OS],
|
||||||
) -> None:
|
) -> None:
|
||||||
|
def try_info_get(data: Any) -> None:
|
||||||
|
self.of.info.get()
|
||||||
|
|
||||||
|
retry(try_info_get, "testing endpoint")
|
||||||
|
|
||||||
self.inject_log(self.start_log_marker)
|
self.inject_log(self.start_log_marker)
|
||||||
for entry in os_list:
|
for entry in os_list:
|
||||||
name = PoolName(f"testpool-{entry.name}-{self.test_id}")
|
name = PoolName(f"testpool-{entry.name}-{self.test_id}")
|
||||||
|
Reference in New Issue
Block a user