fix: Flakey upstream connection test (#3689)

The connectivity state changes for `upstream_connection_state` health field is causing the test to be flakey. Commenting out the field during assertions. `upstream_connection_state` health field is tested in other tests
This commit is contained in:
Elim Tsiagbey authored and GitHub committed 2023-09-07 15:48:53 -04:00
1 parent f89515a19c
commit d271025863
1 file changed
+20 -9
+20 -9
View File
@@ -38,7 +38,6 @@ import (
"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/connectivity"
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/wrapperspb"
)
@@ -724,11 +723,17 @@ func TestCreateOpsHandler(t *testing.T) {
pbResp := &pbs.GetHealthResponse{}
require.NoError(t, jsonpb.Unmarshal(rsp.Body, pbResp))
want := &pbs.GetHealthResponse{WorkerProcessInfo: &pbhealth.HealthInfo{
State: server.ActiveOperationalState.String(),
ActiveSessionCount: wrapperspb.UInt32(0),
UpstreamConnectionState: connectivity.TransientFailure.String(),
State: server.ActiveOperationalState.String(),
ActiveSessionCount: wrapperspb.UInt32(0),
}}
assert.Empty(t, cmp.Diff(want, pbResp, protocmp.Transform()))
assert.Empty(t,
cmp.Diff(
want,
pbResp,
protocmp.Transform(),
protocmp.IgnoreFields(&pbhealth.HealthInfo{}, "upstream_connection_state"),
),
)
},
},
{
@@ -749,11 +754,17 @@ func TestCreateOpsHandler(t *testing.T) {
pbResp := &pbs.GetHealthResponse{}
require.NoError(t, jsonpb.Unmarshal(rsp.Body, pbResp))
want := &pbs.GetHealthResponse{WorkerProcessInfo: &pbhealth.HealthInfo{
State: server.ActiveOperationalState.String(),
ActiveSessionCount: wrapperspb.UInt32(0),
UpstreamConnectionState: connectivity.TransientFailure.String(),
State: server.ActiveOperationalState.String(),
ActiveSessionCount: wrapperspb.UInt32(0),
}}
assert.Empty(t, cmp.Diff(want, pbResp, protocmp.Transform()))
assert.Empty(t,
cmp.Diff(
want,
pbResp,
protocmp.Transform(),
protocmp.IgnoreFields(&pbhealth.HealthInfo{}, "upstream_connection_state"),
),
)
},
},
{