Replace timeout/scaling macros with functions.
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 5aae343..c182288 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -234,6 +234,17 @@
timeout_scaling = 1
if polling_strategy == 'poll-cv':
timeout_scaling *= 5
+
+ # Scale overall test timeout if running under various sanitizers.
+ config = self.args.config
+ if ('asan' in config
+ or config == 'msan'
+ or config == 'tsan'
+ or config == 'ubsan'
+ or config == 'helgrind'
+ or config == 'memcheck'):
+ timeout_scaling *= 20
+
if self.config.build_config in target['exclude_configs']:
continue
if self.args.iomgr_platform in target.get('exclude_iomgrs', []):