tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
R\¬Qc@sÕdZdZdZddlZddlmZmZmZmZedƒZ    ddl
Z
ddl Z ddl m Z e    jƒZde    jfd    „ƒYZd
e
jfd „ƒYZd „Zed krÑeƒndS(sn
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures.  A failure is a bug in tempfile, and may be due to:
 
+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn't still exist.
+ Something we've never seen before.
 
By default, NUM_THREADS == 20 and FILES_PER_THREAD == 50.  This is enough to
create about 150 failures per run under Win98SE in 2.0, and runs pretty
quickly. Guido reports needing to boost FILES_PER_THREAD to 500 before
provoking a 2.0 failure under Linux.
ii2iÿÿÿÿN(tthreading_setuptthreading_cleanupt run_unittestt import_modulet    threading(t    print_exctTempFileGreedycBseZdZdZd„ZRS(icCs‰tjƒ|_tjƒxittƒD][}ytjdƒ}|jƒWn&|j    d7_    t
d|jƒq&X|j d7_ q&WdS(Nsw+bitfile( tStringIOterrorst
startEventtwaittrangetFILES_PER_THREADttempfilet TemporaryFiletcloset error_countRtok_count(tselftitf((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_threadedtempfile.pytrun!s
(t__name__t
__module__RRR(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_threadedtempfile.pyRstThreadedTempFileTestcBseZd„ZRS(cCsg}tƒ}x4ttƒD]&}tƒ}|j|ƒ|jƒqWtjƒd}g}x]|D]U}|jƒ||j    7}|j
rc|jt |j ƒƒt |j jƒƒƒqcqcWt|Œdt|ƒ|dj|ƒf}|j|g|ƒ|j|ttƒdS(NisErrors: errors %d ok %d
%ss
(RR t NUM_THREADSRtappendtstartR
tsettjoinRRtstrtgetNameR    tgetvalueRtlent assertEqualR (Rtthreadst thread_infoRtttokR    tmsg((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_threadedtempfile.pyt    test_main0s&         
 
     3
(RRR)(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_threadedtempfile.pyR/scCsttƒdS(N(RR(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_threadedtempfile.pyR)Jst__main__(t__doc__RR Rttest.test_supportRRRRRtunittestRt    tracebackRtEventR
tThreadRtTestCaseRR)R(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_threadedtempfile.pyt<module>s "