Re: [PATCH v1] t0021: fix flaky test
- From
Jeff King <peff@peff.net>
- Date
- Dec 19, 2016, 20:00 UTC
- Message-ID
- <20161219200034.nkcjfrey5vvakmkf@sigill.intra.peff.net>
- In-Reply-To
- <6e0ea8b0-181a-2ab6-5bab-4f8dfa1d76fa@ramsayjones.plus.com>
On Mon, Dec 19, 2016 at 05:24:32PM +0000, Ramsay Jones wrote:
Show 12 quoted lines
> > t0021.15 creates files, adds them to the index, and commits them. All > > this usually happens in a test run within the same second and Git cannot > > know if the files have been changed between `add` and `commit`. Thus, > > Git has to run the clean filter in both operations. Sometimes these > > invocations spread over two different seconds and Git can infer that the > > files were not changed between `add` and `commit` based on their > > modification timestamp. The test would fail as it expects the filter > > invocation. Remove this expectation to make the test stable. > [...] > I applied this to the pu branch and ran the test by hand > 48 times in a row without failure. (the most trials without > error beforehand was 24).
The original also fails nearly-instantly under my stress script[1], and it runs for several minutes with this patch.
It might be instructive to try all of the tests under that script, but it would require a fair bit of patience (and to some degree, people running "make -j32 test" accomplishes the same thing over time).
-Peff
[1] https://github.com/peff/git/blob/meta/stress