mirror of
https://github.com/status-im/consul.git
synced 2025-01-20 18:50:04 +00:00
fix some flaky snapshot tests (#8015)
This commit is contained in:
parent
a93e9fdd9d
commit
7a46c3908e
@ -15,6 +15,7 @@ import (
|
||||
"github.com/hashicorp/consul/api"
|
||||
"github.com/hashicorp/consul/lib"
|
||||
"github.com/hashicorp/consul/sdk/testutil"
|
||||
"github.com/hashicorp/consul/sdk/testutil/retry"
|
||||
"github.com/mitchellh/cli"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@ -151,6 +152,13 @@ func TestSnapshotSaveCommand_TruncatedStream(t *testing.T) {
|
||||
_, _ = w.Write(data)
|
||||
}))
|
||||
|
||||
// Wait until the server is actually listening.
|
||||
retry.Run(t, func(r *retry.R) {
|
||||
resp, err := http.Get("http://" + fakeAddr + "/not-real")
|
||||
require.NoError(r, err)
|
||||
require.Equal(r, http.StatusNotFound, resp.StatusCode)
|
||||
})
|
||||
|
||||
dir := testutil.TempDir(t, "snapshot")
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user