bigbigbigwaterbucket commented on code in PR #1085:
URL:
https://github.com/apache/incubator-seata-go/pull/1085#discussion_r3004967397
##########
pkg/rm/tcc/fence/handler/tcc_fence_wrapper_handler_test.go:
##########
@@ -1041,3 +1041,92 @@ func TestConstants(t *testing.T) {
assert.Equal(t, 24*time.Hour, cleanExpired)
assert.Equal(t, 5*time.Minute, cleanInterval)
}
+
+func TestDrainCacheTask(t *testing.T) {
+ log.Init()
+
+ oldInterval := cleanInterval
+ cleanInterval = 20 * time.Millisecond
+ defer func() { cleanInterval = oldInterval }()
+
+ db, mock, err := sqlmock.New()
+ assert.NoError(t, err)
+ defer db.Close()
+
+ // drainCacheTask should execute one delete batch with Begin + Commit.
Review Comment:
实现了DAO删除返回错误、Begin返回错误以及Commit返回错误后,将缓存重新入队的功能。测试用例已补全
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]