From e9b282c0be68395d90487439018e891da897b76e Mon Sep 17 00:00:00 2001 From: sunby Date: Mon, 7 Jun 2021 12:01:37 +0800 Subject: [PATCH] Use ElementsMatch to test slice equality (#5641) Signed-off-by: sunby --- internal/dataservice/server_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/dataservice/server_test.go b/internal/dataservice/server_test.go index 804954316c..2bf1469d01 100644 --- a/internal/dataservice/server_test.go +++ b/internal/dataservice/server_test.go @@ -790,7 +790,7 @@ func TestGetRecoveryInfo(t *testing.T) { assert.EqualValues(t, commonpb.ErrorCode_Success, resp.Status.ErrorCode) assert.EqualValues(t, 1, len(resp.GetChannels())) assert.EqualValues(t, 0, len(resp.GetChannels()[0].GetCheckPoints())) - assert.EqualValues(t, []UniqueID{0, 1}, resp.GetChannels()[0].GetFlushedSegments()) + assert.ElementsMatch(t, []UniqueID{0, 1}, resp.GetChannels()[0].GetFlushedSegments()) assert.EqualValues(t, 20, resp.GetChannels()[0].GetSeekPosition().GetTimestamp()) }) @@ -814,7 +814,7 @@ func TestGetRecoveryInfo(t *testing.T) { assert.EqualValues(t, commonpb.ErrorCode_Success, resp.Status.ErrorCode) assert.EqualValues(t, 1, len(resp.GetChannels())) assert.EqualValues(t, 2, len(resp.GetChannels()[0].GetCheckPoints())) - assert.EqualValues(t, []UniqueID{0, 1}, resp.GetChannels()[0].GetFlushedSegments()) + assert.ElementsMatch(t, []UniqueID{0, 1}, resp.GetChannels()[0].GetFlushedSegments()) assert.EqualValues(t, 30, resp.GetChannels()[0].GetSeekPosition().GetTimestamp()) cps := resp.GetChannels()[0].GetCheckPoints() for _, cp := range cps { @@ -856,7 +856,7 @@ func TestGetRecoveryInfo(t *testing.T) { assert.EqualValues(t, 0, resp.GetBinlogs()[0].GetSegmentID()) assert.EqualValues(t, 1, len(resp.GetBinlogs()[0].GetFieldBinlogs())) assert.EqualValues(t, 1, resp.GetBinlogs()[0].GetFieldBinlogs()[0].GetFieldID()) - assert.EqualValues(t, []string{"/binlog/file1", "/binlog/file2"}, resp.GetBinlogs()[0].GetFieldBinlogs()[0].GetBinlogs()) + assert.ElementsMatch(t, []string{"/binlog/file1", "/binlog/file2"}, resp.GetBinlogs()[0].GetFieldBinlogs()[0].GetBinlogs()) }) }