Skip to contentSkip to conversation

t/lib-git-svn.sh: improve svnserve tests with parallel make test

PATCH In review Todd Zullinger 4 participants 20 messages Dec 1, 2017 – Dec 14, 2017

lore
Share & tools
lore
#0 lore raw

cover t/lib-git-svn.sh: improve svnserve tests with parallel make test

These tests are not run by default nor are they enabled in travis-ci. I don't know how much testing they get in user or other packager builds.

I've been slowly increasing the test suite usage in fedora builds. I ran into this while testing locally with parallel make test. The official fedora builds don't run in parallel (yet), as even before I ran into this issue, builds on the fedora builders randomly failed too often. I'm hoping to eventually enable parallel tests by default though, since it's so much faster.

I'm not sure if there's any objection to changing the variable needed to enable the tests from SVNSERVE_PORT to GIT_TEST_SVNSERVE. The way SVNSERVE_PORT is set in this patch should allow the port to be set explicitly, in case someone requires that -- and they understand that it can fail if running parallel tests, of course. Whether that's a feature or a bug, I'm not sure. :)

The indentation of lib-git-svn.sh didn't use tabs consistently, in only a few places, so I cleaned that up first. I can drop that change if it's unwanted.

Todd Zullinger (2):
t/lib-git-svn: whitespace cleanup
t/lib-git-svn.sh: improve svnserve tests with parallel make test

 t/lib-git-svn.sh | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/2 t/lib-git-svn: whitespace cleanup

---
 t/lib-git-svn.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
t/lib-git-svn.sh +11 -11
index 688313ed5c..84366b2624 100644
@@ -17,8 +17,8 @@ SVN_TREE=$GIT_SVN_DIR/svn-tree
 svn >/dev/null 2>&1
 if test $? -ne 1
 then
-    skip_all='skipping git svn tests, svn not found'
-    test_done
+	skip_all='skipping git svn tests, svn not found'
+	test_done
 fi
 
 svnrepo=$PWD/svnrepo
@@ -110,18 +110,18 @@ EOF
 }
 
 require_svnserve () {
-    if test -z "$SVNSERVE_PORT"
-    then
-	skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
-        test_done
-    fi
+	if test -z "$SVNSERVE_PORT"
+	then
+		skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
+		test_done
+	fi
 }
 
 start_svnserve () {
-    svnserve --listen-port $SVNSERVE_PORT \
-             --root "$rawsvnrepo" \
-             --listen-once \
-             --listen-host 127.0.0.1 &
+	svnserve --listen-port $SVNSERVE_PORT \
+		 --root "$rawsvnrepo" \
+		 --listen-once \
+		 --listen-host 127.0.0.1 &
 }
 
 prepare_a_utf8_locale () {
Signature · 1 line
2.15.1
#5 lore raw

PATCH 2/2 t/lib-git-svn.sh: improve svnserve tests with parallel make test

In reply to Todd Zullinger

Previously, setting SVNSERVE_PORT enabled several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share the setup of the local svnserve via start_svnserve(). The function uses the svnserve option --listen-once which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running.

Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

---
 t/lib-git-svn.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
t/lib-git-svn.sh +4 -2
index 84366b2624..4c1f81f167 100644
@@ -110,14 +110,16 @@ EOF
 }
 
 require_svnserve () {
-	if test -z "$SVNSERVE_PORT"
+	test_tristate GIT_TEST_SVNSERVE
+	if ! test "$GIT_TEST_SVNSERVE" = true
 	then
-		skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
+		skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to enable)'
 		test_done
 	fi
 }
 
 start_svnserve () {
+	SVNSERVE_PORT=${SVNSERVE_PORT-${this_test#t}}
 	svnserve --listen-port $SVNSERVE_PORT \
 		 --root "$rawsvnrepo" \
 		 --listen-once \
Signature · 1 line
2.15.1
#13 lore raw
In reply to Todd Zullinger
Quoted 9 lines · Todd Zullinger

These tests are not run by default nor are they enabled in travis-ci. I don't know how much testing they get in user or other packager builds.

I've been slowly increasing the test suite usage in fedora builds. I ran into this while testing locally with parallel make test. The official fedora builds don't run in parallel (yet), as even before I ran into this issue, builds on the fedora builders randomly failed too often. I'm hoping to eventually enable parallel tests by default though, since it's so much faster.

Cool.

Quoted 6 lines

I'm not sure if there's any objection to changing the variable needed to enable the tests from SVNSERVE_PORT to GIT_TEST_SVNSERVE. The way SVNSERVE_PORT is set in this patch should allow the port to be set explicitly, in case someone requires that -- and they understand that it can fail if running parallel tests, of course. Whether that's a feature or a bug, I'm not sure. :)

I'm fine with this for now. Since svnserve (and git-daemon) both support inetd behavior, I think we can eventually have a test helper which binds random ports and pretends to be an inetd, letting the test run without any special setup.

It would let multiple test instances run in parallel, even.

Quoted 3 lines

The indentation of lib-git-svn.sh didn't use tabs consistently, in only a few places, so I cleaned that up first. I can drop that change if it's unwanted.

Fine by me.

#6 lore raw
In reply to Todd Zullinger

Hi,

Quoted 7 lines · Todd Zullinger

Previously, setting SVNSERVE_PORT enabled several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share the setup of the local svnserve via start_svnserve(). The function uses the svnserve option --listen-once which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running.

I had trouble reading this because I didn't know what previous time it was referring to. Is it about how the option currently behaves?

(Git's commit messages tend to use the present tense to describe the behavior before the patch, like a bug report, and the imperative to describe the change the patch proposes to make, like an impolite bug report. :))

Quoted 3 lines

Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

This uses imperative in two ways and also ended up confusing me. The second one is a direction to me, not Git, right? How about:

Use the test number instead of $SVNSERVE_PORT as the svnserve port (similar to httpd tests) to avoid port conflicts. Developers can set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

Quoted 5 lines
---
 t/lib-git-svn.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

The patch looks good. Thanks.

Quoted 26 lines
t/lib-git-svn.sh +4 -2
index 84366b2624..4c1f81f167 100644
@@ -110,14 +110,16 @@ EOF
 }
 
 require_svnserve () {
-	if test -z "$SVNSERVE_PORT"
+	test_tristate GIT_TEST_SVNSERVE
+	if ! test "$GIT_TEST_SVNSERVE" = true
 	then
-		skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
+		skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to enable)'
 		test_done
 	fi
 }
 
 start_svnserve () {
+	SVNSERVE_PORT=${SVNSERVE_PORT-${this_test#t}}
 	svnserve --listen-port $SVNSERVE_PORT \
 		 --root "$rawsvnrepo" \
 		 --listen-once \
Signature · 1 line
2.15.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] t/lib-git-svn: whitespace cleanup

In reply to Todd Zullinger
Quoted 6 lines · Todd Zullinger

Subject: t/lib-git-svn: whitespace cleanup

---
 t/lib-git-svn.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Thanks.

nit: it would have been a tiny bit easier to review if the commit message mentioned that this is only changing the indentation from an inconsistent space/tab mixture to tabs and isn't making any other changes.

#15 lore raw
In reply to Todd Zullinger
Quoted 9 lines · Todd Zullinger

These tests are not run by default nor are they enabled in travis-ci. I don't know how much testing they get in user or other packager builds.

I've been slowly increasing the test suite usage in fedora builds. I ran into this while testing locally with parallel make test. The official fedora builds don't run in parallel (yet), as even before I ran into this issue, builds on the fedora builders randomly failed too often. I'm hoping to eventually enable parallel tests by default though, since it's so much faster.

This background could go in the commit message for patch 2, but it also speaks for itself as an obviously good change so I could go either way.

Quoted 6 lines

I'm not sure if there's any objection to changing the variable needed to enable the tests from SVNSERVE_PORT to GIT_TEST_SVNSERVE. The way SVNSERVE_PORT is set in this patch should allow the port to be set explicitly, in case someone requires that -- and they understand that it can fail if running parallel tests, of course. Whether that's a feature or a bug, I'm not sure. :)

micronit: can this just say something like

Patch 2 is the important one --- see that one for rationale.

Patch 1 is an optional preparatory style cleanup.

next time? That way, you get an automatic guarantee that all the important information is available in "git log" output to people who need it later.

Thanks,
Jonathan

#14 lore raw
In reply to Eric Wong

Hi Eric,

Quoted 6 lines · Eric Wong

I'm fine with this for now. Since svnserve (and git-daemon) both support inetd behavior, I think we can eventually have a test helper which binds random ports and pretends to be an inetd, letting the test run without any special setup.

It would let multiple test instances run in parallel, even.

Indeed, that would be a nice general improvement. :)

Thanks,

Signature · 5 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose I were a member of Congress, and suppose I were an idiot. But,
I repeat myself.
   -- Mark Twain
#16 lore raw
In reply to Jonathan Nieder

Hi Jonathan,

Quoted 12 lines · Jonathan Nieder
Quoted 9 lines · Todd Zullinger

These tests are not run by default nor are they enabled in travis-ci. I don't know how much testing they get in user or other packager builds.

I've been slowly increasing the test suite usage in fedora builds. I ran into this while testing locally with parallel make test. The official fedora builds don't run in parallel (yet), as even before I ran into this issue, builds on the fedora builders randomly failed too often. I'm hoping to eventually enable parallel tests by default though, since it's so much faster.

Quoted 3 lines

This background could go in the commit message for patch 2, but it also speaks for itself as an obviously good change so I could go either way.

Heh. If there's something in there in particular that seems useful, I can certainly add it. I'm not sure what parts of this text would be beneficial to someone down the line though.

I usually err on the 'too much information' side of commit messages. I'm happy that it's much harder to do that here. I'd rather have to skim a long message than wonder about the motivation for a change.

Quoted 9 lines
Quoted 6 lines

I'm not sure if there's any objection to changing the variable needed to enable the tests from SVNSERVE_PORT to GIT_TEST_SVNSERVE. The way SVNSERVE_PORT is set in this patch should allow the port to be set explicitly, in case someone requires that -- and they understand that it can fail if running parallel tests, of course. Whether that's a feature or a bug, I'm not sure. :)

micronit: can this just say something like

Quoted 7 lines

Patch 2 is the important one --- see that one for rationale.

Patch 1 is an optional preparatory style cleanup.

next time? That way, you get an automatic guarantee that all the important information is available in "git log" output to people who need it later.

Yeah, I'll try to remember that. I started this without the whitespace cleanup and as I was writing in the single patch description that I didn't think the whitespace cleanup was warranted, I talked myself into doing it as the prep patch. :)

Thanks,

Signature · 5 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tradition: Just because you've always done it that way doesn't mean
it's not incredibly stupid.
   -- Demotivators (www.despair.com)
#3 lore raw

Re: [PATCH 1/2] t/lib-git-svn: whitespace cleanup

In reply to Jonathan Nieder

Hi Jonathan,

Quoted 4 lines · Jonathan Nieder

nit: it would have been a tiny bit easier to review if the commit message mentioned that this is only changing the indentation from an inconsistent space/tab mixture to tabs and isn't making any other changes.

If only you saw how many times I typed a subject and changed it before settling on the terse version...

How about:

t/lib-git-svn: cleanup inconsistent tab/space usage

?

Thanks,

Signature · 5 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How am I supposed to hallucinate with all these swirling colors
distracting me?
   -- Lisa Simpson
#7 lore raw
In reply to Jonathan Nieder

Hi Jonathan,

Quoted 10 lines · Jonathan Nieder
Quoted 7 lines · Todd Zullinger

Previously, setting SVNSERVE_PORT enabled several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share the setup of the local svnserve via start_svnserve(). The function uses the svnserve option --listen-once which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running.

Quoted 7 lines

I had trouble reading this because I didn't know what previous time it was referring to. Is it about how the option currently behaves?

(Git's commit messages tend to use the present tense to describe the behavior before the patch, like a bug report, and the imperative to describe the change the patch proposes to make, like an impolite bug report. :))

This is what I get for skipping grammar classes to go hiking in my youth. But I'm sure I'd do it all again, if given the chance. ;)

Quoted 11 lines
Quoted 3 lines

Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

This uses imperative in two ways and also ended up confusing me. The second one is a direction to me, not Git, right? How about:

Use the test number instead of $SVNSERVE_PORT as the svnserve port (similar to httpd tests) to avoid port conflicts. Developers can set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

Much better, thank you. How about this for the full commit message:

t/lib-git-svn.sh: improve svnserve tests with parallel make test

Setting SVNSERVE_PORT enables several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share setup of the local svnserve via start_svnserve(). The function uses svnserve's --listen-once option, which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running.

Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Developers can set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

?

Thanks,

Signature · 4 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Curiosity killed the cat, but for awhile I was a suspect.
   -- Steven Wright
Reviewed-by
#8 lore raw
Quoted 12 lines · Todd Zullinger

Much better, thank you. How about this for the full commit message:

t/lib-git-svn.sh: improve svnserve tests with parallel make test

Setting SVNSERVE_PORT enables several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share setup of the local svnserve via start_svnserve(). The function uses svnserve's --listen-once option, which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running.

Quoted 5 lines

Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Developers can set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

?

Yep, with this description it is

Thanks for putting up with my nits. :)

Jonathan

#4 lore raw

Re: [PATCH 1/2] t/lib-git-svn: whitespace cleanup

In reply to Todd Zullinger
Quoted 9 lines · Todd Zullinger
Quoted 4 lines · Jonathan Nieder

nit: it would have been a tiny bit easier to review if the commit message mentioned that this is only changing the indentation from an inconsistent space/tab mixture to tabs and isn't making any other changes.

If only you saw how many times I typed a subject and changed it before settling on the terse version...

Heh. No worries, it was a really small nit.

Quoted 5 lines

How about:

t/lib-git-svn: cleanup inconsistent tab/space usage

?

Sure, looks good.

Thanks again,
Jonathan

#9 lore raw
In reply to Jonathan Nieder
Quoted 3 lines · Jonathan Nieder

Yep, with this description it is Reviewed-by: Jonathan Nieder <[email protected]>

Thanks for putting up with my nits. :)

Thank you for taking the time and looking at the details. :)

I'll send a v2 with the changes in the morning, in case there are any other comments (but mostly because it's late and time for a swim).

Signature · 5 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is impossible to enjoy idling thoroughly unless one has plenty of
work to do.
   -- Jerome K. Jerome
#11 lore raw

PATCH v2 2/2 t/lib-git-svn.sh: improve svnserve tests with parallel make test

In reply to Todd Zullinger

Setting SVNSERVE_PORT enables several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share setup of the local svnserve via start_svnserve(). The function uses svnserve's --listen-once option, which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running.

Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Developers can set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests.

---
 t/lib-git-svn.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
t/lib-git-svn.sh +4 -2
index 84366b2624..4c1f81f167 100644
@@ -110,14 +110,16 @@ EOF
 }
 
 require_svnserve () {
-	if test -z "$SVNSERVE_PORT"
+	test_tristate GIT_TEST_SVNSERVE
+	if ! test "$GIT_TEST_SVNSERVE" = true
 	then
-		skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
+		skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to enable)'
 		test_done
 	fi
 }
 
 start_svnserve () {
+	SVNSERVE_PORT=${SVNSERVE_PORT-${this_test#t}}
 	svnserve --listen-port $SVNSERVE_PORT \
 		 --root "$rawsvnrepo" \
 		 --listen-once \
Signature · 1 line
2.15.1
#10 lore raw

PATCH v2 1/2 t/lib-git-svn: cleanup inconsistent tab/space usage

In reply to Todd Zullinger
---
 t/lib-git-svn.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
t/lib-git-svn.sh +11 -11
index 688313ed5c..84366b2624 100644
@@ -17,8 +17,8 @@ SVN_TREE=$GIT_SVN_DIR/svn-tree
 svn >/dev/null 2>&1
 if test $? -ne 1
 then
-    skip_all='skipping git svn tests, svn not found'
-    test_done
+	skip_all='skipping git svn tests, svn not found'
+	test_done
 fi
 
 svnrepo=$PWD/svnrepo
@@ -110,18 +110,18 @@ EOF
 }
 
 require_svnserve () {
-    if test -z "$SVNSERVE_PORT"
-    then
-	skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
-        test_done
-    fi
+	if test -z "$SVNSERVE_PORT"
+	then
+		skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
+		test_done
+	fi
 }
 
 start_svnserve () {
-    svnserve --listen-port $SVNSERVE_PORT \
-             --root "$rawsvnrepo" \
-             --listen-once \
-             --listen-host 127.0.0.1 &
+	svnserve --listen-port $SVNSERVE_PORT \
+		 --root "$rawsvnrepo" \
+		 --listen-once \
+		 --listen-host 127.0.0.1 &
 }
 
 prepare_a_utf8_locale () {
Signature · 1 line
2.15.1
#17 lore raw

cover t/lib-git-svn.sh: improve svnserve tests with parallel make test

In reply to Todd Zullinger

Hi Junio,

I wanted to check if this minor patch series had slipped under your radar. If it's waiting patiently in your queue for other topics to advance, that's fine, of course. :)

Finished patches: <[email protected]> and <[email protected]>.

Thanks,

Signature · 5 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anyone who is capable of getting themselves made President should on
no account be allowed to do the job.
    -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
#18 lore raw
Quoted 2 lines · Todd Zullinger

I wanted to check if this minor patch series had slipped under your radar.

Totally. Queued.

As they come with Ack by the area maintainer, I'll fast-track them down to 'master' (other topics typically cook at least for a week in 'next').

Thanks for pinging.

#19 lore raw
Quoted 11 lines · Junio C Hamano
Quoted 2 lines · Todd Zullinger

I wanted to check if this minor patch series had slipped under your radar.

Totally. Queued.

As they come with Ack by the area maintainer, I'll fast-track them down to 'master' (other topics typically cook at least for a week in 'next').

Thanks for pinging.

Thank you, as always.

Signature · 5 lines
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is considerable overlap between the intelligence of the smartest
bears and the dumbest tourists.
  -- Park ranger yro.slashdot.org/comments.pl?sid=191810&cid=15757347