File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 44import re
55from concurrent .futures .thread import ThreadPoolExecutor
66from enum import Enum
7+ from functools import cache
78
89import boto3
910from botocore .config import Config
1011from botocore .utils import IMDSFetcher
1112
1213from .vendored import requests
1314
14- # TODO: add this back
15- # from functools import cache
16-
1715
1816class _DetectionState (Enum ):
1917 """Internal enum to represent the detection state of a platform."""
@@ -361,8 +359,7 @@ def is_github_action():
361359 )
362360
363361
364- # TODO: add cache back in once I verify this is the root cause issue
365- # @cache
362+ @cache
366363def detect_platforms (timeout_seconds : float | None ) -> list [str ]:
367364 """
368365 Detect all potential platforms that the current environment may be running on.
Original file line number Diff line number Diff line change @@ -21,9 +21,7 @@ class TestDetectPlatforms:
2121 def teardown (self ):
2222 with patch .dict (os .environ , clear = True ):
2323 yield
24-
25- # TODO: add this back probably once I verify caching is causing the test failures
26- # detect_platforms.cache_clear() # clear cache after each test
24+ detect_platforms .cache_clear () # clear cache after each test
2725
2826 def test_no_platforms_detected (self , broken_metadata_service ):
2927 result = detect_platforms (timeout_seconds = None )
You can’t perform that action at this time.
0 commit comments