mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	修改测试用例
This commit is contained in:
		@@ -10,7 +10,9 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestCreateHTTPAccessLogs(t *testing.T) {
 | 
					func TestCreateHTTPAccessLog(t *testing.T) {
 | 
				
			||||||
 | 
						dbs.NotifyReady()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var tx *dbs.Tx
 | 
						var tx *dbs.Tx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err := NewDBNodeInitializer().loop()
 | 
						err := NewDBNodeInitializer().loop()
 | 
				
			||||||
@@ -26,9 +28,19 @@ func TestCreateHTTPAccessLogs(t *testing.T) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	dao := randomHTTPAccessLogDAO()
 | 
						dao := randomHTTPAccessLogDAO()
 | 
				
			||||||
	t.Log("dao:", dao)
 | 
						t.Log("dao:", dao)
 | 
				
			||||||
	err = SharedHTTPAccessLogDAO.CreateHTTPAccessLogsWithDAO(tx, dao, []*pb.HTTPAccessLog{accessLog})
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						// 先初始化
 | 
				
			||||||
		t.Fatal(err)
 | 
						_ = SharedHTTPAccessLogDAO.CreateHTTPAccessLog(tx, dao.DAO, accessLog)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var before = time.Now()
 | 
				
			||||||
 | 
						defer func() {
 | 
				
			||||||
 | 
							t.Log(time.Since(before).Seconds()*1000, "ms")
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
						for i := 0; i < 1000; i++ {
 | 
				
			||||||
 | 
							err = SharedHTTPAccessLogDAO.CreateHTTPAccessLog(tx, dao.DAO, accessLog)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatal(err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	t.Log("ok")
 | 
						t.Log("ok")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user