Adding timestamps to the beginning of every test file in run_test
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12994
Reviewed By: anderspapitto
Differential Revision: D10515291
Pulled By: pjh5
fbshipit-source-id: 191054cdacff308b63e9063d22d62314398e4f88
diff --git a/test/run_test.py b/test/run_test.py
index 1f5a337..0b888b1 100644
--- a/test/run_test.py
+++ b/test/run_test.py
@@ -3,6 +3,7 @@
from __future__ import print_function
import argparse
+from datetime import datetime
import os
import shlex
import shutil
@@ -371,7 +372,8 @@
test_name = 'test_{}'.format(test)
test_module = parse_test_module(test)
- print_to_stderr('Running {} ...'.format(test_name))
+ # Printing the date here can help diagnose which tests are slow
+ print_to_stderr('Running {} ... [{}]'.format(test_name, datetime.now()))
handler = CUSTOM_HANDLERS.get(test_module, run_test)
return_code = handler(python, test_name, test_directory, options)
assert isinstance(return_code, int) and not isinstance(