From abbe7651930758c85a56ec2d6d7cac24f9738b1c Mon Sep 17 00:00:00 2001 From: Xin Hao Date: Fri, 2 Feb 2024 17:29:49 +0800 Subject: [PATCH] fix tests --- session_pool_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/session_pool_test.go b/session_pool_test.go index 901721f9..1ce797c9 100644 --- a/session_pool_test.go +++ b/session_pool_test.go @@ -389,8 +389,12 @@ func TestSessionPoolApplySchema(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, 1, len(spaces), "should have 1 space") - assert.Equal(t, "test_space_schema", spaces[0].Name, "space name should be test_space_schema") + assert.LessOrEqual(t, 1, len(spaces), "should have at least 1 space") + var spaceNames []string + for _, space := range spaces { + spaceNames = append(spaceNames, space.Name) + } + assert.Contains(t, "test_space_schema", spaceNames, "should have test_space_schema") tagSchema := LabelSchema{ Name: "account", @@ -430,7 +434,7 @@ func TestSessionPoolApplySchema(t *testing.T) { assert.Equal(t, "email", labels[1].Field, "field name should be email") assert.Equal(t, "string", labels[1].Type, "field type should be string") assert.Equal(t, "phone", labels[2].Field, "field name should be phone") - assert.Equal(t, "int64", labels[2].Type, "field type should be string") + assert.Equal(t, "int64", labels[2].Type, "field type should be int64") edgeSchema := LabelSchema{ Name: "account_email",