comparison tests/test-convert-cvs.t @ 24305:867c3649be5d

cvsps: use a different tiebreaker to avoid flaky test After adding some sneaky debug printing[0], I determined that this test flaked when a CVS commit containing two files starts too close to the end of a second, thus putting file "a" in one second and "b/c" in the following second. The secondary sort key meant that these changes sorted in a different order when the timestamps were different than they did when they matched. As far as I can tell, CVS walks through the files in a stable order, so by sorting on the filenames in cvsps we'll get stable output. It's fine for us to switch from sorting on the branchpoint as a secondary key because this was already the point when we didn't care, and we're just trying to break ties in a stable way. It's unclear to be if having the branchpoint present matters anymore, but it doesn't really hurt to leave it. With this change in place, I was able to run test-convert-cvs over 650 times in a row without a failure. test-convert-cvcs-synthetic.t appears to still be flaky, but I don't think it's *worse* than it was before - just not better (I observed one flaky failure in 200 runs on that test). 0: The helpful debug hack ended up being this, in case it's useful to future flaky test assassins: --- a/hgext/convert/cvsps.py +++ b/hgext/convert/cvsps.py @@ -854,6 +854,8 @@ def debugcvsps(ui, *args, **opts): ui.write(('Branch: %s\n' % (cs.branch or 'HEAD'))) ui.write(('Tag%s: %s \n' % (['', 's'][len(cs.tags) > 1], ','.join(cs.tags) or '(none)'))) + if cs.comment == 'ci1' and (cs.id == 6) == bool(cs.branchpoints): + ui.write('raw timestamp %r\n' % (cs.date,)) if cs.branchpoints: ui.write(('Branchpoints: %s \n') % ', '.join(sorted(cs.branchpoints)))
author Augie Fackler <raf@durin42.com>
date Fri, 13 Mar 2015 14:20:13 -0400
parents 96529f81e2e9
children 1abfe639a70c
comparison
equal deleted inserted replaced
24303:15afda349b11 24305:867c3649be5d
395 PatchSet 5 395 PatchSet 5
396 Date: * (glob) 396 Date: * (glob)
397 Author: * (glob) 397 Author: * (glob)
398 Branch: HEAD 398 Branch: HEAD
399 Tag: (none) 399 Tag: (none)
400 Branchpoints: branch
400 Log: 401 Log:
401 ci1 402 ci1
402 403
403 Members: 404 Members:
405 a:1.1->1.2
406
407 ---------------------
408 PatchSet 6
409 Date: * (glob)
410 Author: * (glob)
411 Branch: HEAD
412 Tag: (none)
413 Log:
414 ci1
415
416 Members:
404 b/c:1.2->1.3 417 b/c:1.2->1.3
405
406 ---------------------
407 PatchSet 6
408 Date: * (glob)
409 Author: * (glob)
410 Branch: HEAD
411 Tag: (none)
412 Branchpoints: branch
413 Log:
414 ci1
415
416 Members:
417 a:1.1->1.2
418 418
419 --------------------- 419 ---------------------
420 PatchSet 7 420 PatchSet 7
421 Date: * (glob) 421 Date: * (glob)
422 Author: * (glob) 422 Author: * (glob)