@@ -144,7 +144,7 @@ def fun(self):
144
144
testmod = "test." + testfile_stem
145
145
cmd = [timeout , "-s" , "9" , "60" ] + executable + ["-S" , "-m" ]
146
146
tagfile = os .path .join (TAGS_DIR , testfile_stem + ".txt" )
147
- if retag :
147
+ if retag and repeat == 0 :
148
148
test_selectors = []
149
149
else :
150
150
test_selectors = working_selectors (tagfile )
@@ -167,17 +167,7 @@ def fun(self):
167
167
print ("*stderr*" )
168
168
print (p .stderr )
169
169
170
- if p .returncode == 0 and not os .path .exists (tagfile ):
171
- # if we're re-tagging a test without tags, all passed
172
- with open (tagfile , "w" ) as f :
173
- pass
174
- break
175
- elif p .returncode == 0 :
176
- # we ran the tagged tests and they were fine
177
- break
178
- elif repeat < maxrepeats :
179
- # we failed the first run, create a tag file with the passing
180
- # tests (if any)
170
+ if repeat < maxrepeats :
181
171
passing_tests = []
182
172
failed_tests = []
183
173
@@ -219,7 +209,7 @@ def get_pass_name(funcname, classname):
219
209
# the passed patterns
220
210
passing_only_patterns = set (passing_tests ) - set (failed_tests )
221
211
with open (tagfile , "w" ) as f :
222
- for passing_test in passing_only_patterns :
212
+ for passing_test in sorted ( passing_only_patterns ) :
223
213
f .write (passing_test )
224
214
f .write ("\n " )
225
215
if not passing_only_patterns :
@@ -228,3 +218,6 @@ def get_pass_name(funcname, classname):
228
218
# we tried the last time and failed, so our tags don't work for
229
219
# some reason
230
220
os .unlink (tagfile )
221
+
222
+ if p .returncode == 0 :
223
+ break
0 commit comments