tests/test-transaction-rollback-on-sigpipe.t
changeset 47618 27ff81547d35
parent 47615 a8d1adeeba87
child 47920 9c4204b7f3e4
equal deleted inserted replaced
47617:d5fc1b59a2df 47618:27ff81547d35
    24 
    24 
    25   $ cat >remote/.hg/hgrc <<EOF
    25   $ cat >remote/.hg/hgrc <<EOF
    26   > [hooks]
    26   > [hooks]
    27   > pretxnchangegroup.00-break-things=sh "$RUNTESTDIR/testlib/wait-on-file" 10 "$SYNCFILE2" "$SYNCFILE1"
    27   > pretxnchangegroup.00-break-things=sh "$RUNTESTDIR/testlib/wait-on-file" 10 "$SYNCFILE2" "$SYNCFILE1"
    28   > pretxnchangegroup.01-output-things=echo "some remote output to be forward to the closed pipe"
    28   > pretxnchangegroup.01-output-things=echo "some remote output to be forward to the closed pipe"
       
    29   > pretxnchangegroup.02-output-things=echo "some more remote output"
    29   > EOF
    30   > EOF
    30 
    31 
    31   $ hg --cwd ./remote tip -T '{node|short}\n'
    32   $ hg --cwd ./remote tip -T '{node|short}\n'
    32   000000000000
    33   000000000000
    33   $ cd local
    34   $ cd local
    34   $ echo foo > foo ; hg commit -qAm "commit"
    35   $ echo foo > foo ; hg commit -qAm "commit"
    35   $ hg push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --remotecmd "$remotecmd"
    36 
    36   pushing to ssh://user@dummy/$TESTTMP/remote
    37 (use quiet to avoid flacky output from the server)
    37   searching for changes
    38 
    38   remote: adding changesets (py3 !)
    39   $ hg push --quiet -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --remotecmd "$remotecmd"
    39   remote: adding manifests (py3 !)
       
    40   remote: adding file changes (py3 !)
       
    41   remote: adding changesets (no-py3 no-chg !)
       
    42   remote: adding manifests (no-py3 no-chg !)
       
    43   remote: adding file changes (no-py3 no-chg !)
       
    44   abort: stream ended unexpectedly (got 0 bytes, expected 4)
    40   abort: stream ended unexpectedly (got 0 bytes, expected 4)
    45   [255]
    41   [255]
    46   $ cat $SIGPIPE_REMOTE_DEBUG_FILE
    42   $ cat $SIGPIPE_REMOTE_DEBUG_FILE
    47   SIGPIPE-HELPER: Starting
    43   SIGPIPE-HELPER: Starting
    48   SIGPIPE-HELPER: Mercurial started
       
    49   SIGPIPE-HELPER: Redirection in place
    44   SIGPIPE-HELPER: Redirection in place
       
    45   SIGPIPE-HELPER: pipes closed in main
    50   SIGPIPE-HELPER: SYNCFILE1 detected
    46   SIGPIPE-HELPER: SYNCFILE1 detected
    51   SIGPIPE-HELPER: pipes closed
    47   SIGPIPE-HELPER: worker killed
    52   SIGPIPE-HELPER: creating SYNCFILE2
    48   SIGPIPE-HELPER: creating SYNCFILE2
    53   SIGPIPE-HELPER: Shutting down
    49   SIGPIPE-HELPER: Shutting down
    54   SIGPIPE-HELPER: Server process terminated
    50   SIGPIPE-HELPER: Server process terminated with status 255 (no-windows !)
       
    51   SIGPIPE-HELPER: Server process terminated with status 1 (windows !)
    55   SIGPIPE-HELPER: Shut down
    52   SIGPIPE-HELPER: Shut down
    56 
    53 
    57 The remote should be left in a good state
    54 The remote should be left in a good state
    58   $ hg --cwd ../remote tip -T '{node|short}\n'
    55   $ hg --cwd ../remote tip -T '{node|short}\n'
    59   000000000000
    56   000000000000
       
    57 
       
    58 #if windows
       
    59 
       
    60 XXX-Windows Broken behavior to be fixed
       
    61 
       
    62 Behavior on Windows is broken and should be fixed. However this is a fairly
       
    63 corner case situation and no data are being corrupted. This would affect
       
    64 central repository being hosted on a Windows machine and accessed using ssh.
       
    65 
       
    66 This was catch as we setup new CI for Windows. Making the test pass on Windows
       
    67 was enough of a pain that fixing the behavior set aside for now. Dear and
       
    68 honorable reader, feel free to fix it.
       
    69 
       
    70   $ hg --cwd ../remote recover
       
    71   rolling back interrupted transaction
       
    72   (verify step skipped, run `hg verify` to check your repository content)
       
    73 
       
    74 #else
       
    75 
    60   $ hg --cwd ../remote recover
    76   $ hg --cwd ../remote recover
    61   no interrupted transaction available
    77   no interrupted transaction available
    62   [1]
    78   [1]
       
    79 
       
    80 #endif