# HG changeset patch # User Matt Harbison # Date 1548646329 18000 # Node ID 3757a968d63ad17205b55b80def05d485947b18b # Parent 080a5c83914fae866b523c478002c689f66a2eee py3: stabilize the output of lfs commandserver tests The print() statements were being output at the very end, so write to the same stdout sink as runcommand, and explicitly flush. diff -r 080a5c83914f -r 3757a968d63a tests/test-lfs-serve.t --- a/tests/test-lfs-serve.t Sun Jan 27 20:58:18 2019 -0500 +++ b/tests/test-lfs-serve.t Sun Jan 27 22:32:09 2019 -0500 @@ -359,12 +359,13 @@ $ cp $HGRCPATH.orig $HGRCPATH >>> from __future__ import absolute_import - >>> from hgclient import check, readchannel, runcommand + >>> from hgclient import bprint, check, readchannel, runcommand, stdout >>> @check ... def checkflags(server): ... readchannel(server) - ... print('') - ... print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag') + ... bprint(b'') + ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag') + ... stdout.flush() ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R', ... b'../server']) ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R', @@ -372,7 +373,8 @@ ... runcommand(server, [b'config', b'extensions', b'--cwd', ... b'../server']) ... - ... print("\n# LFS not enabled- revlogs don't have 0x2000 flag") + ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag") + ... stdout.flush() ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt']) ... runcommand(server, [b'config', b'extensions']) @@ -403,12 +405,13 @@ > EOF >>> from __future__ import absolute_import, print_function - >>> from hgclient import check, readchannel, runcommand + >>> from hgclient import bprint, check, readchannel, runcommand, stdout >>> @check ... def checkflags2(server): ... readchannel(server) - ... print('') - ... print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag') + ... bprint(b'') + ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag') + ... stdout.flush() ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R', ... b'../server']) ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R', @@ -416,11 +419,13 @@ ... runcommand(server, [b'config', b'extensions', b'--cwd', ... b'../server']) ... - ... print('\n# LFS enabled without requirement- revlogs have 0x2000 flag') + ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag') + ... stdout.flush() ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt']) ... runcommand(server, [b'config', b'extensions']) ... - ... print("\n# LFS disabled locally- revlogs don't have 0x2000 flag") + ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag") + ... stdout.flush() ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R', ... b'../nonlfs']) ... runcommand(server, [b'config', b'extensions', b'--cwd',