From 37c97fd966bd6144dafcd1af6039539463927e12 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 14 Nov 2024 22:49:10 +0800 Subject: [PATCH] fix data race issue --- pkg/types/connectivitygroup_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/types/connectivitygroup_test.go b/pkg/types/connectivitygroup_test.go index 20d852c96..3400dfad9 100644 --- a/pkg/types/connectivitygroup_test.go +++ b/pkg/types/connectivitygroup_test.go @@ -144,10 +144,9 @@ func TestConnectivityGroup(t *testing.T) { assert.True(t, authed1) assert.True(t, authed2) - assert.Equal(t, ConnectivityStateAuthed, group.sumState) + assert.Equal(t, ConnectivityStateAuthed, group.GetState()) assert.True(t, group.IsConnected()) assert.True(t, group.IsAuthed()) - assert.Equal(t, ConnectivityStateAuthed, callbackState) }) t.Run("allAuthedC with 2 diff groups", func(t *testing.T) { @@ -175,7 +174,7 @@ func TestConnectivityGroup(t *testing.T) { conn1.setConnect() conn2.setConnect() - assert.Equal(t, ConnectivityStateConnected, group1.sumState) + assert.Equal(t, ConnectivityStateConnected, group1.GetState()) assert.True(t, group1.IsConnected()) assert.False(t, group1.IsAuthed()) assert.Equal(t, ConnectivityStateConnected, callbackState) @@ -206,11 +205,11 @@ func TestConnectivityGroup(t *testing.T) { assert.True(t, authed1) assert.True(t, authed2) - assert.Equal(t, ConnectivityStateAuthed, group1.sumState) + assert.Equal(t, ConnectivityStateAuthed, group1.GetState()) assert.True(t, group1.IsConnected()) assert.True(t, group1.IsAuthed()) - assert.Equal(t, ConnectivityStateAuthed, group2.sumState) + assert.Equal(t, ConnectivityStateAuthed, group2.GetState()) assert.True(t, group2.IsConnected()) assert.True(t, group2.IsAuthed()) })