pubsub: small fixes for end-to-end tests

Fixing that some channels are never closed during tests.

Change-Id: Ife9ece48c7d3cf0a113c54130c93fae30d5acc7b
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/54870
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alex Hong <hongalex@google.com>
diff --git a/pubsub/internal/longtest/endtoend_test.go b/pubsub/internal/longtest/endtoend_test.go
index 88ed7d7..6a6218b 100644
--- a/pubsub/internal/longtest/endtoend_test.go
+++ b/pubsub/internal/longtest/endtoend_test.go
@@ -136,6 +136,7 @@
 		}
 	}
 	wg.Wait()
+	close(recv)
 	for i, con := range consumers {
 		var numDups int
 		var zeroes int
@@ -149,7 +150,7 @@
 		if zeroes > 0 {
 			t.Errorf("Consumer %d: %d messages never arrived", i, zeroes)
 		} else if numDups > numAcceptableDups {
-			t.Errorf("Consumer %d: Willing to accept %d dups (%v duplicated of %d messages), but got %d", i, numAcceptableDups, acceptableDupPercentage, int(nMessages), numDups)
+			t.Errorf("Consumer %d: Willing to accept %d dups (%v%% duplicated of %d messages), but got %d", i, numAcceptableDups, acceptableDupPercentage, int(nMessages), numDups)
 		}
 	}
 
@@ -230,6 +231,7 @@
 			t.Fatal("timed out")
 		}
 	}
+	close(recv)
 	var numDups int
 	var zeroes int
 	for _, v := range consumer.counts {
@@ -275,7 +277,7 @@
 	// there are 5 3 second durations, then there will be 5 3 second Receives.
 	durations []time.Duration
 
-	// A value is sent to recv each time Inc is called.
+	// A value is sent to recv each time process is called.
 	recv chan struct{}
 
 	// How long to wait for before acking.