tests/test-wireproto-command-lookup.t
author Raphaël Gomès <rgomes@octobus.net>
Fri, 11 Feb 2022 23:43:17 +0100
branchstable
changeset 48741 46d12f7762e4
parent 45109 b1507ab0c6cf
permissions -rw-r--r--
dirstate-v2: fix infinite loop in pure packer Due to the naive approach to path relative-ness, some tree shapes like the one introduced in the associated test could result in the packer going into an endless loop which allocated new `Node` objects endlessly until the process was killed by Linux's OOM killer. Differential Revision: https://phab.mercurial-scm.org/D12170

  $ . $TESTDIR/wireprotohelpers.sh

  $ hg init server
  $ enablehttpv2 server
  $ cd server
  $ cat >> .hg/hgrc << EOF
  > [web]
  > push_ssl = false
  > allow-push = *
  > EOF
  $ hg debugdrawdag << EOF
  > C D
  > |/
  > B
  > |
  > A
  > EOF
  $ root_node=$(hg log -r A -T '{node}')

  $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
  $ cat hg.pid > $DAEMON_PIDS

lookup for known node works

  $ sendhttpv2peer << EOF
  > command lookup
  >     key $root_node
  > EOF
  creating http peer for wire protocol version 2
  sending lookup command
  response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0'

  $ cat error.log