From 8ac177a6de16f6ce360309a7d034c911908eccae Mon Sep 17 00:00:00 2001 From: John Guo Date: Thu, 16 Jun 2022 17:41:15 +0800 Subject: [PATCH] improve UT for package gredis --- database/gredis/gredis_z_unit_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/database/gredis/gredis_z_unit_test.go b/database/gredis/gredis_z_unit_test.go index 2671fbc97..3e9645121 100644 --- a/database/gredis/gredis_z_unit_test.go +++ b/database/gredis/gredis_z_unit_test.go @@ -168,9 +168,13 @@ func Test_Error(t *testing.T) { _, err = conn.Do(ctx, "Subscribe", "gf") t.AssertNil(err) + time.Sleep(time.Second) + _, err = redis.Do(ctx, "PUBLISH", "gf", "test") t.AssertNil(err) + time.Sleep(time.Second) + v, err = conn.Receive(ctx) t.AssertNil(err) t.Assert(v.Val().(*gredis.Subscription).Channel, "gf")