[ISSUE-5522] Fix profiler timeout (#6448)

* ChangeIsFunction by IsMethod

* Update test

* Remove whitespace
This commit is contained in:
Francisco J. Jurado Moreno 2022-07-30 19:03:10 +02:00 committed by GitHub
parent c4e88b69fa
commit 512b241069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -65,7 +65,7 @@ def cls_timeout(seconds: int = TEN_MIN):
"""
def inner(cls):
for attr_name, attr in inspect.getmembers(cls, inspect.isfunction):
for attr_name, attr in inspect.getmembers(cls, inspect.ismethod):
setattr(cls, attr_name, timeout(seconds)(getattr(cls, attr_name)))
return cls

View File

@ -43,13 +43,11 @@ class Timer:
Helper to test timeouts
"""
@staticmethod
def slow():
def slow(self):
time.sleep(10)
return 1
@staticmethod
def fast():
def fast(self):
return 1
@ -65,7 +63,6 @@ class RunnerTest(TestCase):
sample = sampler.random_sample()
raw_runner = QueryRunner(session=session, table=User, sample=sample)
timeout_runner: Timer = cls_timeout(1)(Timer())
@classmethod