class_docstr: Base class for K8S Tests.
class_docstr_tok: ["Base","class","for","K8S","Tests","."]
code: def _ensure_airflow_webserver_is_healthy(self):
      max_tries = 10
      timeout_seconds = 5
      for i in range(max_tries):
          try:
              response = self.session.get(
                  f"http://{KUBERNETES_HOST_PORT}/health",
                  timeout=1,
              )
              if response.status_code == 200:
                  print("Airflow webserver is healthy!")
                  return
          except Exception as e:
              print(
                  f"Exception when checking if webserver is healthy {e}"
              )
              if i < max_tries - 1:
                  print(f"Waiting {timeout_seconds} s and retrying.")
                  time.sleep(timeout_seconds)
      raise Exception(
          f"Giving up. The webserver of Airflow was not healthy after {max_tries} tries "
          f"with {timeout_seconds} s delays"
      )
  
imports: from __future__ import annotations
  import os
  import subprocess
  import tempfile
  import time
  from datetime import datetime
  from pathlib import Path
  from subprocess import check_call, check_output
  import pytest
  import re2
  import requests
  import requests.exceptions
  from requests.adapters import HTTPAdapter
  from urllib3.util.retry import Retry
label_desc: Use image node_id 6 for calling the BaseK8STest obj's underlying member method code with example usage: obj._ensure_airflow_webserver_is_healthy() without return types