test: use T.TempDir
to create temporary test directory
#21043
+57
−194
Merged