This is an archive of the discontinued Mercurial Phabricator instance.

tests: handle case in test-remotefilelog-clone.t where output is out of order
ClosedPublic

Authored by swhitaker on Nov 1 2017, 7:46 AM.
Tags
None
Subscribers

Details

Summary

test-remotefilelog-clone.t is flaky, and fails sporadically as follows:

   $ hg clone --noupdate ssh://user@dummy/shallow full
   streaming all changes
+  abort: unexpected response from remote server: empty string
   remote: abort: Cannot clone from a shallow repo to a full repo.
-  abort: unexpected response from remote server: empty string
   [255]

The issue happens because the line starting "abort" and the line starting
"remote: abort" come from different processes, and there's no way to
guarantee the order in which they are output.

This change attempts to address the issue by capturing the output of the
local process and examining it separately.

Test Plan

rt test-remotefilelog-clone.t

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

swhitaker created this revision.Nov 1 2017, 7:46 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 1 2017, 7:46 AM
swhitaker updated this revision to Diff 3190.Nov 1 2017, 7:49 AM
swhitaker updated this revision to Diff 3200.Nov 2 2017, 10:09 AM
ikostia accepted this revision.Nov 2 2017, 10:22 AM
This revision is now accepted and ready to land.Nov 2 2017, 10:22 AM
durham added a subscriber: durham.Nov 2 2017, 1:35 PM

This broke check code

+++ /data/sandcastle/boxes/trunk-hg-facebook-hg-rpms/facebook-hg-rpms/fb-hgext/tests/test-check-code-hg.t.err
@@ -100,6 +100,9 @@
    >   $ echo "rpmbin = /bin/rpm" >> .hg/hgrc
    don't use explicit paths for tools
   Skipping tests/test-remotefilelog-bad-configs.t it has no-che?k-code (glob)
+  tests/test-remotefilelog-clone.t:81:
+   > was failing sporadically. To avoid this, we capture STDERR to a file and 
+   trailing whitespace on non-output
   [1]
durham added a comment.Nov 2 2017, 1:37 PM

I've pushed a fix for check code.

This revision was automatically updated to reflect the committed changes.