This operation can fail due to log file contention, waiting should reduce this occurance.
An alternative is to retry, but that requires quite a few lines in Python so this seems more appropriate.
0[00:27:35] Traceback (most recent call last):
1[00:27:35] File "C:\projects\bitcoin/test/functional/feature_notifications.py", line 88, in <module>
2[00:27:35] NotificationsTest().main()
3[00:27:35] File "C:\projects\bitcoin\test\functional\test_framework\test_framework.py", line 223, in main
4[00:27:35] shutil.rmtree(self.options.tmpdir)
5[00:27:35] File "C:\Python37-x64\lib\shutil.py", line 507, in rmtree
6[00:27:35] return _rmtree_unsafe(path, onerror)
7[00:27:35] File "C:\Python37-x64\lib\shutil.py", line 386, in _rmtree_unsafe
8[00:27:35] _rmtree_unsafe(fullname, onerror)
9[00:27:35] File "C:\Python37-x64\lib\shutil.py", line 386, in _rmtree_unsafe
10[00:27:35] _rmtree_unsafe(fullname, onerror)
11[00:27:35] File "C:\Python37-x64\lib\shutil.py", line 391, in _rmtree_unsafe
12[00:27:35] onerror(os.unlink, fullname, sys.exc_info())
13[00:27:35] File "C:\Python37-x64\lib\shutil.py", line 389, in _rmtree_unsafe
14[00:27:35] os.unlink(fullname)
15[00:27:35] PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\test_runner_20190115_020102\\feature_notifications_45\\node0\\regtest\\debug.log'
https://ci.appveyor.com/project/DrahtBot/bitcoin/builds/21618398