Skip to content
Snippets Groups Projects
  1. Feb 22, 2025
  2. Jan 07, 2025
  3. Nov 28, 2024
  4. Oct 07, 2024
    • Matt Harbison's avatar
      tests: stabilize `test-clonebundles.t` on Windows · d8b981968a55
      Matt Harbison authored
      The `remote: {foo,bar}` lines were different because `echo` in MSYS uses `\r\n`.
      I couldn't make it work with the previous echoing of individual lines, changing
      the internal `echo` to `printf "foo\n"`, because that output as "foon".  This
      works on Linux and Windows, so I'm not thinking too hard about it.
      d8b981968a55
  5. Jun 27, 2024
  6. Oct 02, 2024
    • Matt Harbison's avatar
      tests: use pattern matching to mask `ECONNREFUSED` messages · 73a43fe3e6fd
      Matt Harbison authored
      The second and third one of these in `test-http-proxy.t` was failing on Windows.
      The others were found by grep and by failed tests when output was matched and an
      attempt was made to emit the mask pattern.
      
      The first clonebundles failure on Windows emitted:
      
          error fetching bundle: [WinError 10061] $ECONNREFUSED$
      
      We should probably stringify that better to get rid of the "[WinError 10061]"
      part.
      73a43fe3e6fd
  7. Feb 27, 2024
  8. Dec 11, 2023
    • Pierre-Yves David's avatar
      changelog: never inline changelog · dcaa2df1f688
      Pierre-Yves David authored
      The test suite mostly use small repositories, that implies that most changelog in the
      tests are inlined. As a result, non-inlined changelog are quite poorly tested.
      Since non-inline changelog are most common case for serious repositories, this
      lack of testing is a significant problem that results in high profile issue like
      the one recently fixed by 66417f55ea33 and 849745d7da89.
      
      Inlining the changelog does not bring much to the table, the number of total
      file saved is negligible, and the changelog will be read by most operation
      anyway.
      
      So this changeset is make it so we never inline the changelog, and de-inline the
      one that are still inlined whenever we touch them.
      
      By doing that, we remove the "dual code path" situation for writing new entry to
      the changelog and move to a "single code path" situation. Having a single
      code path simplify the code and make sure it is covered by test (if test cover
      that situation obviously)
      
      
      This impact all tests that care about the number of file and the exchange size,
      but there is nothing too complicated in them just a lot of churn.
      
      The churn is made "worse" by the fact rust will use the persistent nodemap on
      any changelog now. Which is overall a win as it means testing the persistent
      nodemap more and having less special cases.
      
      In short, having inline changelog is mostly useless and an endless source of
      pain. We get rid of it.
      dcaa2df1f688
  9. Jun 19, 2023
  10. Jun 17, 2023
  11. Apr 20, 2023
  12. Apr 17, 2023
    • Pierre-Yves David's avatar
      revlog-split: make sure the self._indexfile attribut is reset (issue6811) · f952be90b051
      Pierre-Yves David authored
      Before this change, after a transaction committing a file split, a revlog
      object would have its `self._indexfile` attribute desynchronised from the
      actual file storing the data. If that same object is reused (as we do for the
      manifest during clone bundles), this lead to the data being writting in the
      wrong location and the repository to go corrupt.
      
      We not properly reset the attribut when applicable and everything is back in
      working order.
      6.4.2
      f952be90b051
    • Pierre-Yves David's avatar
      revlog-split: show manifest data loss situation when using clonebundle · 54f68495ab2a
      Pierre-Yves David authored
      After the commit of the transaction from applying the clone bundle, changes to
      the manifest from the subsequent pull would write index data in the wrong file.
      This lead to data being "lost" after the pull and the repository to be
      corrupted. We add a test checking this specific scenario.
      
      In practice, the issue only affects the manifest but we also test the issue with a file for future proofing things up.
      
      See test documentation and failure for details.
      54f68495ab2a
  13. Jan 27, 2022
    • Pierre-Yves David's avatar
      stream-clone: allow to change persistent-nodemap format during stream clone · de3ac3d2c60b
      Pierre-Yves David authored
      Persistent nodemap affect the store format. However it is fairly isolated and
      fast to generate locally. So not making it a fixed part of the stream clone is
      useful.
      
      This allow clients without persistent-nodemap support (default for client
      without Rust enabled, or simply older client). So it make it possible to enable
      persistent nodemap on client, where it can provide a massive boost. without too
      much consequence.
      
      To do so, we stop using it in the advertisement requirements for streaming and
      let the client add/remove the necessary file depending of its configuration.
      
      We still send the files as it seems like a small save to not regenerate them.
      In addition, the way we match them will overlap with the changelog-v2/revlog-v2
      so we can't simply skip the associated patterns.
      
      Differential Revision: https://phab.mercurial-scm.org/D12096
      de3ac3d2c60b
  14. Jan 24, 2022
    • Pierre-Yves David's avatar
      requirements: add an official `REVLOG_COMPRESSION_ZSTD` const · 6fd9a17c32ab
      Pierre-Yves David authored
      Such constant was missing and its value was missing from the set of requirements
      that needs to be preserved through stream clone. This did not had any
      consequence yet as the "bundle 2 does not filter its requirements" is shadowing
      the issue.
      
      However we are now in a situation where we can fix this issue. So lets do it
      next.
      
      With the preparation work on test, changing the streamreqs value only impact two
      tests, where checking the full value seems to remains relevant.
      
      Important note: Since older version of Mercurial used the old `supportedformat`
      class attribute to check for stream requirement they supported, older version
      will consider this requirements to prevent them from using streaming clone. Even
      as they support this requirements for years. Pack for stable will be send to fix
      it, but they will have to be backported to older version if needed.
      
      Differential Revision: https://phab.mercurial-scm.org/D12083
      6fd9a17c32ab
  15. Aug 03, 2021
    • sliquister's avatar
      tests: rely on dummyssh being the default · 9c4204b7f3e4
      sliquister authored
      This commit is exactly the result of running this command:
      
      sed -i -e 's! *\(-e \|--ssh \|--config ui.ssh=\)[ \"]*$PYTHON[ \"]*$\(RUN\|\)TESTDIR/dummyssh[\"]* *! !g' -e '/^[ >]*ssh *=[ "]*$PYTHON[ "]*$\(RUN\|\)TESTDIR\/dummyssh[ "]*$/d' -e 's/^\(  [$] .*[^ ]\) *$/\1/' *.t *.sh
      
      Sometimes the tests can be simplified further, but I think it's
      preferable to do the simplification separately.
      
      Differential Revision: https://phab.mercurial-scm.org/D11245
      9c4204b7f3e4
  16. Jan 14, 2021
  17. Mar 04, 2021
  18. Jan 15, 2021
    • Pierre-Yves David's avatar
      clone: make sure we warm the cache after a clone · 95a615dd77bf
      Pierre-Yves David authored
      This work around any deviciency/limitation of the clone process. In our case
      this ensure the persistent nodemap exist with valid content.
      
      Ideally, the cloning process would also do "the right thing". However since
      older server will never be able to do "the right thing". The local workaround
      will be necessary anyway.
      
      I am not worried by the performance impact of this as `hg clone` is non-instant
      on large repositories where is could matters. Warming the cache if they are
      already correct is very fast. And if they are not already warm, this seems like
      a good time to do so.
      
      This impact various test as more cache are now warmed sooner, all the change
      should be harmless.
      
      Differential Revision: https://phab.mercurial-scm.org/D9789
      95a615dd77bf
  19. Jun 21, 2020
  20. May 30, 2020
  21. Mar 26, 2020
  22. Jan 22, 2020
  23. Sep 18, 2019
  24. May 17, 2019
    • Augie Fackler's avatar
      tests: fix test-clonebundles on recent openbsd · da3861ef7959
      Augie Fackler authored
      I guess openbsd feels like it needs to stringify this errno in
      lowercase and omit the "host" part of "hostname. Okay.
      
      Reported in a big test diff talking about libressl, see 6122. I'm not
      flagging this because most of that issue is about a libressl string
      change, so this doesn't really make a big difference there.
      
      Differential Revision: https://phab.mercurial-scm.org/D6399
      da3861ef7959
  25. Feb 07, 2019
  26. Dec 16, 2018
  27. Nov 12, 2018
  28. Oct 18, 2018
  29. Oct 01, 2018
    • Gregory Szorc's avatar
      httppeer: report http statistics · 393e44324037
      Gregory Szorc authored
      Now that keepalive.py records HTTP request count and the
      number of bytes sent and received as part of performing those
      requests, we can easily print a report on the activity when
      closing a peer instance!
      
      Exact byte counts are globbed in tests because they are influenced
      by non-deterministic things, such as hostnames and port numbers.
      Plus, the exact byte count isn't too important anyway.
      
      I feel obliged to note that printing the byte count could have
      security implications. e.g. if sending a password via HTTP basic
      auth, the length of that password will influence the byte count
      and the reporting of the byte count could be a side-channel leak
      of the password length. I /think/ this is beyond our threshold
      for concern. But if we think it poses a problem, we can teach the
      byte count logging code to e.g. ignore sensitive HTTP request
      headers. We could also consider not reporting the byte count of
      request headers altogether. But since the wire protocol uses HTTP
      headers for sending command arguments, it is kind of important to
      report their size.
      
      Differential Revision: https://phab.mercurial-scm.org/D4858
      393e44324037
  30. Sep 17, 2018
    • Anton Shestakov's avatar
      bundle2: make server.bundle2.stream default to True · 4bd6e444c76f
      Anton Shestakov authored
      Support for bundle2 streaming clones has been shipped in Mercurial 4.5
      (7eedbd5d4880), but was never activated by default. It's time to have more
      people use it. The new format allows streaming clones to transport cache
      (hooray for speed) and phaseroots (fixes phase-related issues).
      
      Changes in tests:
      
      bundle2 capabilities now have "stream=v2" (plus a '\n' as a separator) and
      therefore take 14 bytes more: "%0Astream%3Dv2". Tip for tests that have data
      encoded with CBOR: 0xd3 - 0xc5 = 14.
      
      $USUAL_BUNDLE2_CAPS$ replaces $USUAL_BUNDLE2_CAPS_SERVER$, which is the same
      thing, but without "stream=v2".
      
      Since streaming clones now also transfer caches, the reported byte and file
      counts are higher (e.g. 816 bytes in 9 files instead of 613 bytes in 4 files,
      a bit of --debug and manual math confirms that the caches take these extra 203
      bytes in 5 files).
      
      Differential Revision: https://phab.mercurial-scm.org/D4680
      4bd6e444c76f
  31. Aug 03, 2018
    • Augie Fackler's avatar
      tests: update test expectations in pre-2.7.9 branch of this test · c9e6ca31cfe7
      Augie Fackler authored
      As far as I can tell this is the only spot that got overlooked. Rough
      test methodology (run inside an hg working copy):
      
      docker run --rm -v `pwd`:/hg -it debian:wheezy bash
      apt-get update
      apt-get install python python-dev build-essential unzip mercurial \
        wget libbz2-dev
      make testpy-2.7.8
      
      You could try and use the system Python, but it's 2.7.3 and has lots
      of issues for hg these days that are not worth fixing.
      
      Differential Revision: https://phab.mercurial-scm.org/D4070
      c9e6ca31cfe7
  32. Jun 05, 2018
  33. Jun 04, 2018
  34. Jun 06, 2018
  35. May 24, 2018
    • Denis Laxalde's avatar
      transaction-summary: show phase changes statistics in pull/unbundle · eb9835014d20
      Denis Laxalde authored
      Upon pull or unbundle, we display a message with the number of
      changesets which phase became public. Noticeably, this new message would
      appear even if no new changeset were added (below the "no changes found"
      message), thus indicating that something actually happened to the local
      repository.
      eb9835014d20
Loading