git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix flaky untracked-cache test
@ 2015-10-19 19:48 David Turner
  2015-10-21  5:42 ` Torsten Bögershausen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Turner @ 2015-10-19 19:48 UTC (permalink / raw)
  To: git, pclouds, larsxschneider, tboegi; +Cc: David Turner

Dirty the test worktree's root directory, as the test expects.

When testing the untracked-cache, we previously assumed that checking
out master would be sufficient to mark the mtime of the worktree's
root directory as racily-dirty.  But sometimes, the checkout would
happen at 12345.999 seconds and the status at 12346.001 seconds,
meaning that the worktree's root directory would not be racily-dirty.
And since it was not truly dirty, occasionally the test would fail.
By making the root truly dirty, the test will always succeed.

Tested by running a few hundred times.

Signed-off-by: David Turner <dturner@twopensource.com>
---
 t/t7063-status-untracked-cache.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index 37a24c1..0e8d0d4 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -412,7 +412,9 @@ test_expect_success 'create/modify files, some of which are gitignored' '
 	echo two bis >done/two &&
 	echo three >done/three && # three is gitignored
 	echo four >done/four && # four is gitignored at a higher level
-	echo five >done/five # five is not gitignored
+	echo five >done/five && # five is not gitignored
+	echo test >base && #we need to ensure that the root dir is touched
+	rm base
 '
 
 test_expect_success 'test sparse status with untracked cache' '
-- 
2.4.2.644.g97b850b-twtrsrc

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix flaky untracked-cache test
  2015-10-19 19:48 [PATCH] fix flaky untracked-cache test David Turner
@ 2015-10-21  5:42 ` Torsten Bögershausen
  2015-10-21 16:32   ` David Turner
  2015-10-21 20:25 ` Duy Nguyen
  2015-10-21 22:47 ` Lars Schneider
  2 siblings, 1 reply; 5+ messages in thread
From: Torsten Bögershausen @ 2015-10-21  5:42 UTC (permalink / raw)
  To: David Turner, git, pclouds, larsxschneider, tboegi

On 19.10.15 21:48, David Turner wrote:

> +	echo test >base && #we need to ensure that the root dir is touched
> +	rm base
>  '
Thanks for working on this, (I can run the test as soon as I have access to a Mac with SSD)
Minor remark, the echo test can be removed (and may be the comment ?)
> +	>base &&
> +	rm base
>  '

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix flaky untracked-cache test
  2015-10-21  5:42 ` Torsten Bögershausen
@ 2015-10-21 16:32   ` David Turner
  0 siblings, 0 replies; 5+ messages in thread
From: David Turner @ 2015-10-21 16:32 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: git, pclouds, larsxschneider

On Wed, 2015-10-21 at 07:42 +0200, Torsten Bögershausen wrote:
> On 19.10.15 21:48, David Turner wrote:
> 
> > +	echo test >base && #we need to ensure that the root dir is touched
> > +	rm base
> >  '
> Thanks for working on this, (I can run the test as soon as I have access to a Mac with SSD)

I don't think this depends on a Mac (I can repro on my Thinkpad running
Ubuntu).

> Minor remark, the echo test can be removed (and may be the comment ?)

All the other lines in this test have echo, so I would rather be
consistent.

> > +	>base &&
> > +	rm base
> >  '

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix flaky untracked-cache test
  2015-10-19 19:48 [PATCH] fix flaky untracked-cache test David Turner
  2015-10-21  5:42 ` Torsten Bögershausen
@ 2015-10-21 20:25 ` Duy Nguyen
  2015-10-21 22:47 ` Lars Schneider
  2 siblings, 0 replies; 5+ messages in thread
From: Duy Nguyen @ 2015-10-21 20:25 UTC (permalink / raw)
  To: David Turner; +Cc: Git Mailing List, larsxschneider, Torsten Bögershausen

On Mon, Oct 19, 2015 at 9:48 PM, David Turner <dturner@twopensource.com> wrote:
> Dirty the test worktree's root directory, as the test expects.
>
> When testing the untracked-cache, we previously assumed that checking
> out master would be sufficient to mark the mtime of the worktree's
> root directory as racily-dirty.  But sometimes, the checkout would
> happen at 12345.999 seconds and the status at 12346.001 seconds,
> meaning that the worktree's root directory would not be racily-dirty.
> And since it was not truly dirty, occasionally the test would fail.
> By making the root truly dirty, the test will always succeed.

I'm sorry for my deadly silence lately. I hope it will end in a few
weeks. From a quick glance, the description and the change look ok
(but don't weigh too much on my opinion).

Back to my silence..
-- 
Duy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix flaky untracked-cache test
  2015-10-19 19:48 [PATCH] fix flaky untracked-cache test David Turner
  2015-10-21  5:42 ` Torsten Bögershausen
  2015-10-21 20:25 ` Duy Nguyen
@ 2015-10-21 22:47 ` Lars Schneider
  2 siblings, 0 replies; 5+ messages in thread
From: Lars Schneider @ 2015-10-21 22:47 UTC (permalink / raw)
  To: David Turner; +Cc: git, pclouds, tboegi

Looks good to me, Ack.

Test run with 74301d6 + my TravisCI patch:
https://travis-ci.org/larsxschneider/git/builds/86702932
... on Linux it failed in 1/2 cases after 53min
... on OSX it failed in 2/2 cases after 6min

Test run with 74301d6 + my TravisCI patch + David's t7063 patch:
https://travis-ci.org/larsxschneider/git/builds/86707133
.. on Linux it failed in 0/2 cases after 77min
...on OSX it failed in 0/2 cases after 48min (no error, CI system timed out, click on the builds to see detailed log output)

Cheers,
Lars

On 19 Oct 2015, at 21:48, David Turner <dturner@twopensource.com> wrote:

> Dirty the test worktree's root directory, as the test expects.
> 
> When testing the untracked-cache, we previously assumed that checking
> out master would be sufficient to mark the mtime of the worktree's
> root directory as racily-dirty.  But sometimes, the checkout would
> happen at 12345.999 seconds and the status at 12346.001 seconds,
> meaning that the worktree's root directory would not be racily-dirty.
> And since it was not truly dirty, occasionally the test would fail.
> By making the root truly dirty, the test will always succeed.
> 
> Tested by running a few hundred times.
> 
> Signed-off-by: David Turner <dturner@twopensource.com>
> ---
> t/t7063-status-untracked-cache.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
> index 37a24c1..0e8d0d4 100755
> --- a/t/t7063-status-untracked-cache.sh
> +++ b/t/t7063-status-untracked-cache.sh
> @@ -412,7 +412,9 @@ test_expect_success 'create/modify files, some of which are gitignored' '
> 	echo two bis >done/two &&
> 	echo three >done/three && # three is gitignored
> 	echo four >done/four && # four is gitignored at a higher level
> -	echo five >done/five # five is not gitignored
> +	echo five >done/five && # five is not gitignored
> +	echo test >base && #we need to ensure that the root dir is touched
> +	rm base
> '
> 
> test_expect_success 'test sparse status with untracked cache' '
> -- 
> 2.4.2.644.g97b850b-twtrsrc
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-21 22:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-19 19:48 [PATCH] fix flaky untracked-cache test David Turner
2015-10-21  5:42 ` Torsten Bögershausen
2015-10-21 16:32   ` David Turner
2015-10-21 20:25 ` Duy Nguyen
2015-10-21 22:47 ` Lars Schneider

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).