From 0fe900258a52cf204856fcfdfd5ee965a7b701af Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith [Google LLC]" Date: Mon, 18 Apr 2022 22:12:05 +0000 Subject: [PATCH 1/3] Make environment change warnings always verbose. not to be submitted, just for debugging what's up in 3.10 CI. --- Lib/test/libregrtest/save_env.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index f0bfcf389992d8..449bf9ce398fe1 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -319,8 +319,9 @@ def __exit__(self, exc_type, exc_val, exc_tb): if current != original: support.environment_altered = True restore(original) - if not self.quiet and not self.pgo: - print_warning(f"{name} was modified by {self.testname}") - print(f" Before: {original}\n After: {current} ", - file=sys.stderr, flush=True) + if not self.pgo: + print_warning( + f"{name} was modified by {self.testname}\n" + f" Before: {original}\n" + f" After: {current} ") return False From ba7512233eee962a9bba7852cbef246fed5778c9 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith [Google LLC]" Date: Mon, 18 Apr 2022 23:38:43 +0000 Subject: [PATCH 2/3] wild goose chase... compare before and after ident --- Lib/test/support/threading_helper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/test/support/threading_helper.py b/Lib/test/support/threading_helper.py index 92a64e8354acbc..ec8b5305ae9adb 100644 --- a/Lib/test/support/threading_helper.py +++ b/Lib/test/support/threading_helper.py @@ -21,14 +21,14 @@ def threading_setup(): - return _thread._count(), threading._dangling.copy() + return _thread._count(), threading._dangling.copy(), threading.get_ident() def threading_cleanup(*original_values): _MAX_COUNT = 100 for count in range(_MAX_COUNT): - values = _thread._count(), threading._dangling + values = _thread._count(), threading._dangling, threading.get_ident() if values == original_values: break @@ -39,7 +39,8 @@ def threading_cleanup(*original_values): support.print_warning(f"threading_cleanup() failed to cleanup " f"{values[0] - original_values[0]} threads " f"(count: {values[0]}, " - f"dangling: {len(dangling_threads)})") + f"dangling: {len(dangling_threads)}), ") + f"ident before {values[2]} ident after {values[2]})") for thread in dangling_threads: support.print_warning(f"Dangling thread: {thread!r}") From bdf0bb620e3d4fa552c78beaa10481556808e00d Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith [Google LLC]" Date: Mon, 18 Apr 2022 23:48:11 +0000 Subject: [PATCH 3/3] typo --- Lib/test/support/threading_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/support/threading_helper.py b/Lib/test/support/threading_helper.py index ec8b5305ae9adb..30750e2e5e945a 100644 --- a/Lib/test/support/threading_helper.py +++ b/Lib/test/support/threading_helper.py @@ -39,7 +39,7 @@ def threading_cleanup(*original_values): support.print_warning(f"threading_cleanup() failed to cleanup " f"{values[0] - original_values[0]} threads " f"(count: {values[0]}, " - f"dangling: {len(dangling_threads)}), ") + f"dangling: {len(dangling_threads)}), " f"ident before {values[2]} ident after {values[2]})") for thread in dangling_threads: support.print_warning(f"Dangling thread: {thread!r}")