@@ -403,7 +403,10 @@ func TestSmokeGetRetention(t *testing.T) {
403
403
}
404
404
405
405
func TestActivateHotTier (t * testing.T ) {
406
+ CreateStream (t , NewGlob .QueryClient , NewGlob .Stream )
406
407
activateHotTier (t )
408
+ disableHotTier (t )
409
+ DeleteStream (t , NewGlob .QueryClient , NewGlob .Stream )
407
410
}
408
411
409
412
func TestHotTierGetsLogs (t * testing.T ) {
@@ -419,31 +422,22 @@ func TestHotTierGetsLogsAfter(t *testing.T) {
419
422
t .Skip ("Skipping in standalone mode" )
420
423
}
421
424
422
- logs := createAndIngest (t )
425
+ // create a stream without hot tier
426
+ createAndIngest (t )
427
+ time .Sleep (2 * 60 * time .Second )
428
+ prevCount := QueryLogStreamCount (t , NewGlob .QueryClient , NewGlob .Stream , 200 )
429
+ DeleteStream (t , NewGlob .QueryClient , NewGlob .Stream )
423
430
431
+ // create a second stream with hot tier
432
+ createAndIngest (t )
424
433
activateHotTier (t )
425
- time .Sleep (60 * 2 * time .Second ) // wait for 2 minutes to allow hot tier to sync
426
-
427
- // fetch the logs from hot tier
428
- req , _ := NewGlob .QueryClient .NewRequest ("GET" , "logstream/" + NewGlob .Stream + "/hottier" , nil )
429
- response , err := NewGlob .QueryClient .Do (req )
430
- require .NoErrorf (t , err , "Fetching hot tier stream failed: %s" , err )
431
-
432
- // ascertain that they are in expected schema. prolly will be, just to be sure
433
- body , err := readJsonBody [StreamHotTier ](response .Body )
434
- require .NoErrorf (t , err , "Hot tier response not in correct schema: %s" , err )
435
-
436
- // get total byte count of ingested logs
437
- size := 0
438
- for _ , expectedlog := range logs {
439
- size = size + int (expectedlog .ByteCount )
440
- }
441
-
442
- // ascertain that the ingested all the ingested logs are present in hot tier
443
- require .Equalf (t , size , "%d" , * body .UsedSize , "Total size of ingested logs is %d GiB but hot tier contains %d GiB" , size , body .UsedSize )
434
+ time .Sleep (2 * 60 * time .Second ) // wait 2 minutes for hot tier to sync
444
435
436
+ htCount := QueryLogStreamCount (t , NewGlob .QueryClient , NewGlob .Stream , 200 )
445
437
disableHotTier (t )
446
438
DeleteStream (t , NewGlob .QueryClient , NewGlob .Stream )
439
+
440
+ require .Equalf (t , prevCount , htCount , "With hot tier disabled, the count was %s but with it, the count is %s" , prevCount , htCount )
447
441
}
448
442
449
443
// create stream, ingest data, query get count, set hot tier, wait for 2-3 mins, query again get count, both counts should match
@@ -453,12 +447,12 @@ func TestHotTierLogCount(t *testing.T) {
453
447
}
454
448
455
449
createAndIngest (t )
456
- countBefore := QueryLogStreamCount (t , NewGlob .QueryClient , NewGlob .Stream , 50 )
450
+ countBefore := QueryLogStreamCount (t , NewGlob .QueryClient , NewGlob .Stream , 200 )
457
451
458
452
activateHotTier (t )
459
453
time .Sleep (60 * 2 * time .Second ) // wait for 2 minutes to allow hot tier to sync
460
454
461
- countAfter := QueryLogStreamCount (t , NewGlob .QueryClient , NewGlob .Stream , 50 )
455
+ countAfter := QueryLogStreamCount (t , NewGlob .QueryClient , NewGlob .Stream , 200 )
462
456
require .Equalf (t , countBefore , countAfter , "Ingested %s, but hot tier contains only %s" , countBefore , countAfter )
463
457
}
464
458
0 commit comments