Skip to content

Commit

Permalink
run the three main test types in parallel
Browse files Browse the repository at this point in the history
Saves about six seconds overall, as each test currently involves a
three second sleep.
  • Loading branch information
bradfitz committed Sep 4, 2023
1 parent d8906ed commit 553e0d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions memcache/memcache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
const localhostTCPAddr = "localhost:11211"

func TestLocalhost(t *testing.T) {
t.Parallel()
c, err := net.Dial("tcp", localhostTCPAddr)
if err != nil {
t.Skipf("skipping test; no server running at %s", localhostTCPAddr)
Expand All @@ -45,6 +46,7 @@ func TestLocalhost(t *testing.T) {

// Run the memcached binary as a child process and connect to its unix socket.
func TestUnixSocket(t *testing.T) {
t.Parallel()
sock := fmt.Sprintf("/tmp/test-gomemcache-%d.sock", os.Getpid())
cmd := exec.Command("memcached", "-s", sock)
if err := cmd.Start(); err != nil {
Expand All @@ -66,6 +68,7 @@ func TestUnixSocket(t *testing.T) {
}

func TestFakeServer(t *testing.T) {
t.Parallel()
ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("failed to listen: %v", err)
Expand Down

0 comments on commit 553e0d5

Please sign in to comment.