Re: [PATCH v2 0/2] t7900: fix flaky "maintenance.strategy" test

Karthik Nayak <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <CAOLa=ZQmZ0spmdPOzCZe36i24nQh+o7d4fSz5dcJS7+O3p2skg@mail.gmail.com>
Patrick Steinhardt <[email protected]> writes:

> Hi,
>
> I've recently noticed that t7900 is flaky, see for example [1].
> The root cause of the flake is the auto-detaching logic of
> git-maintenance(1), which sometimes causes us to skip maintenance
> altogether when the foreground process is racing with background
> maintenance.
>
> Changes in v2:
>   - Perform some word smithing on commit messages.
>   - Link to v1: https://patch.msgid.link/[email protected]
>
> Thanks!
>
> Patrick
>
> [1]: https://gitlab.com/gitlab-org/git/-/jobs/15762975482
>
> ---
> Patrick Steinhardt (2):
>       t7900: adapt some tests to use a throwaway repository
>       t7900: fix flaky "maintenance.strategy" test
>
>  t/t7900-maintenance.sh | 76 ++++++++++++++++++++++++++++++--------------------
>  1 file changed, 46 insertions(+), 30 deletions(-)
>
> Range-diff versus v1:
>
> 1:  10521f07ad ! 1:  1f3f8aa538 t7900: adapt some tests to use a throwaway repository
>     @@ Commit message
>          tests more neatly self-contained and allows us to trivially modify the
>          environment in the next commit.
>
>     +    Note that we adapt calls to `test_config ()` to use git-config(1)
>     +    instead. This is because on the one hand we don't need the auto-revert
>     +    logic of `test_config ()` as we're using a throwaway repository anyway.
>     +    On the other hand it's not possible to use `test_config ()` as it uses
>     +    `test_when_finished ()`, which errors out when we run it in a subshell.
>     +
>          Signed-off-by: Patrick Steinhardt <[email protected]>
>
>       ## t/t7900-maintenance.sh ##
> 2:  71cb84a4a7 ! 2:  ba1fbb27f9 t7900: fix flaky "maintenance.strategy" test
>     @@ Commit message
>
>          But there's a second condition that may cause us to not execute tasks,
>          namely when the "maintenance.lock" file exists due to a concurrently
>     -    running tasks. We usually disable auto-maintenance from detaching in our
>     -    test suite to avoid exactly these kinds of race conditions, but in t7900
>     +    running git-maintenance(1) process. We usually disable auto-maintenance
>     +    from detaching in our test suite to avoid exactly these kinds of race
>     +    conditions by exporting `GIT_TEST_MAINT_AUTO_DETACH=false`. But in t7900
>          we unset "GIT_TEST_MAINT_AUTO_DETACH" and thus enable the auto-detach
>          logic. The intent of this is to exercise git-maintenance(1) closer to
>          how it would run in a real-world scenario, but it does cause us to race
>
> ---
> base-commit: 2c78326f810173a4f3aefd8021f1e07575412481
> change-id: 20260807-pks-t7900-fix-flaky-test-160abfcef65a

The range diff and this version looks good. Thanks!
signature.asc (application/pgp-signature, 690 B)
-----BEGIN PGP SIGNATURE-----

iQHKBAEBCgA0FiEEV85Mf2N1cQ/LZcYGPtWfJI5GjH8FAmp9s6oWHGthcnRoaWsu
MTg4QGdtYWlsLmNvbQAKCRA+1Z8kjkaMf9BhDACXTxE0vXelL6JA18Fz5f/4yJ7/
e2JEq+hv4WncTEcAaEbs20hxAinV7dQAACFT3qjGHkl7xfal88tSJ/uOjlQQmiom
r5eUr17LaBltSsxSHOti/NZCaShGlZTMkTjDrYz8Lgh3U+rn1Xlm2g5+CZGxwknx
EifOGicTzRg9ZPVJugWiIYWbT5QLahK5+sZkv36PRqnMevDy4gEtpuAohjZ5cL5W
czHHu/vbmrzweiqui3nedKiiJiyjmlUmf7kC1jv2GlvfCtgnmJqcc3VPLm/5kWJ0
wYSsNKo4qm4UuBvf8/AYttHaWFm7mBn3toLfQT50+16YAFJBqWk1Jj5zSldkwqVX
TWjWA5rCE7wW42tAy9ny4wnnRFFj+sEC0jZnjdRhNNUJ/kQsyre2vEDF1My5ZlPe
UyyWgI5M77sI6WurASmHIXz4eS1L1KdZqoCoxaPMuLkgflsCdekHVbauXudgSU0g
UO+qZACJPuc6k4yrmaJ92zPpb4IKfMl+icbNdHE=
=csHM
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.