Skip to content

Commit a20667c

Browse files
authored
fix flaky test (Azure#17639)
1 parent 2ac677f commit a20667c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdk/internal/perf/recording_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package perf
55

66
import (
77
"net/http"
8+
"regexp"
89
"testing"
910

1011
"github.com/stretchr/testify/require"
@@ -22,7 +23,9 @@ func TestRecordingHTTPClient_Do(t *testing.T) {
2223

2324
resp, err := client.Do(req)
2425
require.NoError(t, err)
25-
require.Contains(t, resp.Request.URL.String(), "https://www.bing.com")
26+
matched, err := regexp.MatchString(`https://www\d*\.bing\.com`, resp.Request.URL.String())
27+
require.NoError(t, err)
28+
require.True(t, matched)
2629

2730
proxyTransportsSuite[t.Name()].SetMode("record")
2831
req, err = http.NewRequest("POST", "https://www.bing.com", nil)

0 commit comments

Comments
 (0)