@@ -63,7 +63,7 @@ func TestPerformanceMonitor_SetCache_Mock(t *testing.T) {
6363 ctx := context .Background ()
6464 taskResult := createTestTaskResult ("test-task" , uint64 (time .Now ().Unix ()))
6565 s .Close ()
66-
66+
6767 err := pm .setCache (ctx , taskResult )
6868 assert .Error (t , err )
6969 })
@@ -79,7 +79,7 @@ func TestPerformanceMonitor_Get_Mock(t *testing.T) {
7979
8080 t .Run ("successful Get" , func (t * testing.T ) {
8181 taskResult := createTestTaskResult ("test-task" , uint64 (time .Now ().Unix ()))
82-
82+
8383 ctx := context .Background ()
8484 err := pm .setCache (ctx , taskResult )
8585 require .NoError (t , err )
@@ -109,7 +109,7 @@ func TestPerformanceMonitor_Get_Mock(t *testing.T) {
109109 t .Run ("Get with invalid JSON" , func (t * testing.T ) {
110110 s2 := miniredis .RunT (t )
111111 pm2 , err := newTestPerformanceMonitorWithMockRedis (s2 .Addr ())
112- require .NoError (t , err )
112+ require .NoError (t , err )
113113 s2 .Set (generateKey ("test-task" ), "{invalid json" )
114114 result , err := pm2 .Get ("test-task" )
115115 assert .Error (t , err )
@@ -164,7 +164,7 @@ func TestPerformanceMonitor_GetAll_Mock(t *testing.T) {
164164 ctx := context .Background ()
165165 task1 := createTestTaskResult ("task1" , uint64 (time .Now ().Unix ()))
166166 task2 := createTestTaskResult ("task2" , uint64 (time .Now ().Unix ()- 100 ))
167-
167+
168168 err := pm .setCache (ctx , task1 )
169169 require .NoError (t , err )
170170 err = pm .setCache (ctx , task2 )
@@ -173,7 +173,7 @@ func TestPerformanceMonitor_GetAll_Mock(t *testing.T) {
173173 results , err := pm .GetAll ()
174174 assert .NoError (t , err )
175175 assert .Len (t , results , 2 )
176-
176+
177177 taskNames := []string {results [0 ].Name , results [1 ].Name }
178178 assert .Contains (t , taskNames , "task1" )
179179 assert .Contains (t , taskNames , "task2" )
@@ -201,12 +201,12 @@ func TestPerformanceMonitor_GetAll_Mock(t *testing.T) {
201201 s3 := miniredis .RunT (t )
202202 pm3 , err := newTestPerformanceMonitorWithMockRedis (s3 .Addr ())
203203 require .NoError (t , err )
204-
204+
205205 ctx := context .Background ()
206206 validTask := createTestTaskResult ("valid-task" , uint64 (time .Now ().Unix ()))
207207 err = pm3 .setCache (ctx , validTask )
208208 require .NoError (t , err )
209-
209+
210210 s3 .Set (generateKey ("corrupted-task" ), "{invalid json" )
211211
212212 results , err := pm3 .GetAll ()
@@ -235,4 +235,5 @@ func TestGenerateKey(t *testing.T) {
235235 assert .Equal (t , tc .expected , result )
236236 })
237237 }
238- }
238+ }
239+
0 commit comments