You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: udp_test.go
    path of file: ./repos/cloudprober/probes/udp
    
    the code of the file until where you have to start completion: // Copyright 2017-2021 The Cloudprober Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Wor
    
func TestSuccessMultipleCasesDefaultResult(t *testing.T) {
	cases := []struct {
		name        string
		interval    time.Duration
		timeout     time.Duration
		delay       time.Duration
		probeCount  int
		useAllPorts bool
		pktCount    int64
	}{
		// 10 probes, probing each target from 2 ports, at the interval of 200ms, with 100ms timeout and 10ms delay on server.
		{"success_normal", 200, 100, 10, 10, true, 20},
		// 20 probes, probing each target from 2 ports, at the interval of 100ms, with 1000ms timeout and 50ms delay on server.
		{"success_timeout_larger_than_interval_1", 100, 1000, 50, 20, true, 40},
		// 20 probes, probing each target from 2 ports, at the interval of 100ms, with 1000ms timeout and 200ms delay on server.
		{"success_timeout_larger_than_interval_2", 100, 1000, 200, 20, true, 40},
		// 10 probes, probing each target just once, at the interval of 200ms, with 100ms timeout and 10ms delay on server.
		{"single_port", 200, 100, 10, 10, false, 10},
	}

	for _, c := range cases {
		ctx, cancelServerCtx := context.WithCancel(context.Background())
		port, scs := startUDPServer(ctx, t, false, c.delay*time.Millisecond)
		t.Logf("Case(%s): started server on port %d with delay %v", c.name, port, c.delay)
		conf := &configpb.ProbeConf{
			UseAllTxPortsPerProbe: proto.Bool(c.useAllPorts),
			Port:                  proto.Int32(int32(port)),
			ExportMetricsByPort:   proto.Bool(false),
		}

		p := runProbe(t, c.interval*time.Millisecond, c.timeout*time.Millisecond, c.probeCount, scs, conf)
		cancelServerCtx()

		if len(p.connList) != numTxPorts {
			t.Errorf("Case(%s): len(p.connList)=%d, want %d", c.name, len(p.connList), numTxPorts)
		}
		res := p.res[flow{"", "localhost"}]
		if res.total != c.pktCount {
			t.Errorf("Case(%s): p.res[_].total=%d, want %d", c.name, res.total, c.pktCount)
		}
		if res.success != c.pktCount {
			t.Errorf("Case(%s): p.res[_].success=%d want %d", c.name, res.success, c.pktCount)
		}
		if res.delayed != 0 {
			t.Errorf("Case(%s): p.res[_].delayed=%d, want 0", c.name, res.delayed)
		}
	}
}