@@ -177,9 +177,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
177177 {
178178 name : "test one partition is not visited and contains block marked for deletion" ,
179179 expectedResult : PartitionedGroupStatus {
180- CanDelete : true ,
181- IsCompleted : false ,
182- DeleteVisitMarker : true ,
180+ CanDelete : true ,
181+ IsCompleted : false ,
182+ VisitMarkersToDelete : [] VisitMarker {} ,
183183 PendingOrFailedPartitions : []Partition {
184184 {
185185 PartitionID : 1 ,
@@ -230,9 +230,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
230230 {
231231 name : "test one partition is pending and contains block marked for deletion" ,
232232 expectedResult : PartitionedGroupStatus {
233- CanDelete : true ,
234- IsCompleted : false ,
235- DeleteVisitMarker : true ,
233+ CanDelete : true ,
234+ IsCompleted : false ,
235+ VisitMarkersToDelete : [] VisitMarker {} ,
236236 PendingOrFailedPartitions : []Partition {
237237 {
238238 PartitionID : 1 ,
@@ -292,7 +292,7 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
292292 expectedResult : PartitionedGroupStatus {
293293 CanDelete : false ,
294294 IsCompleted : false ,
295- DeleteVisitMarker : false ,
295+ VisitMarkersToDelete : [] VisitMarker {} ,
296296 PendingOrFailedPartitions : []Partition {},
297297 },
298298 partitionedGroupInfo : PartitionedGroupInfo {
@@ -342,9 +342,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
342342 {
343343 name : "test one partition is pending expired" ,
344344 expectedResult : PartitionedGroupStatus {
345- CanDelete : false ,
346- IsCompleted : false ,
347- DeleteVisitMarker : false ,
345+ CanDelete : false ,
346+ IsCompleted : false ,
347+ VisitMarkersToDelete : [] VisitMarker {} ,
348348 PendingOrFailedPartitions : []Partition {
349349 {
350350 PartitionID : 0 ,
@@ -400,9 +400,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
400400 {
401401 name : "test one partition is complete with one block deleted and one partition is not visited with no blocks deleted" ,
402402 expectedResult : PartitionedGroupStatus {
403- CanDelete : false ,
404- IsCompleted : false ,
405- DeleteVisitMarker : false ,
403+ CanDelete : false ,
404+ IsCompleted : false ,
405+ VisitMarkersToDelete : [] VisitMarker {} ,
406406 PendingOrFailedPartitions : []Partition {
407407 {
408408 PartitionID : 1 ,
@@ -453,9 +453,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
453453 {
454454 name : "test one partition is complete and one partition is failed with no blocks deleted" ,
455455 expectedResult : PartitionedGroupStatus {
456- CanDelete : false ,
457- IsCompleted : false ,
458- DeleteVisitMarker : false ,
456+ CanDelete : false ,
457+ IsCompleted : false ,
458+ VisitMarkersToDelete : [] VisitMarker {} ,
459459 PendingOrFailedPartitions : []Partition {
460460 {
461461 PartitionID : 1 ,
@@ -511,9 +511,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
511511 {
512512 name : "test one partition is complete and one partition is failed one block deleted" ,
513513 expectedResult : PartitionedGroupStatus {
514- CanDelete : true ,
515- IsCompleted : false ,
516- DeleteVisitMarker : true ,
514+ CanDelete : true ,
515+ IsCompleted : false ,
516+ VisitMarkersToDelete : [] VisitMarker {} ,
517517 PendingOrFailedPartitions : []Partition {
518518 {
519519 PartitionID : 1 ,
@@ -573,7 +573,7 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
573573 expectedResult : PartitionedGroupStatus {
574574 CanDelete : true ,
575575 IsCompleted : true ,
576- DeleteVisitMarker : true ,
576+ VisitMarkersToDelete : [] VisitMarker {} ,
577577 PendingOrFailedPartitions : []Partition {},
578578 },
579579 partitionedGroupInfo : PartitionedGroupInfo {
@@ -623,9 +623,24 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
623623 {
624624 name : "test partitioned group created after visit marker" ,
625625 expectedResult : PartitionedGroupStatus {
626- CanDelete : false ,
627- IsCompleted : false ,
628- DeleteVisitMarker : true ,
626+ CanDelete : false ,
627+ IsCompleted : false ,
628+ VisitMarkersToDelete : []VisitMarker {
629+ & partitionVisitMarker {
630+ PartitionedGroupID : partitionedGroupID ,
631+ PartitionID : 0 ,
632+ Status : Completed ,
633+ VisitTime : time .Now ().Add (- 2 * time .Minute ).Unix (),
634+ Version : PartitionVisitMarkerVersion1 ,
635+ },
636+ & partitionVisitMarker {
637+ PartitionedGroupID : partitionedGroupID ,
638+ PartitionID : 1 ,
639+ Status : Completed ,
640+ VisitTime : time .Now ().Add (- 2 * time .Minute ).Unix (),
641+ Version : PartitionVisitMarkerVersion1 ,
642+ },
643+ },
629644 PendingOrFailedPartitions : []Partition {},
630645 },
631646 partitionedGroupInfo : PartitionedGroupInfo {
@@ -675,7 +690,7 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
675690 expectedResult : PartitionedGroupStatus {
676691 CanDelete : false ,
677692 IsCompleted : false ,
678- DeleteVisitMarker : false ,
693+ VisitMarkersToDelete : [] VisitMarker {} ,
679694 PendingOrFailedPartitions : []Partition {},
680695 },
681696 partitionedGroupInfo : PartitionedGroupInfo {
@@ -725,9 +740,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
725740 {
726741 name : "test one partition is not visited and contains block with no compact mark" ,
727742 expectedResult : PartitionedGroupStatus {
728- CanDelete : true ,
729- IsCompleted : false ,
730- DeleteVisitMarker : true ,
743+ CanDelete : true ,
744+ IsCompleted : false ,
745+ VisitMarkersToDelete : [] VisitMarker {} ,
731746 PendingOrFailedPartitions : []Partition {
732747 {
733748 PartitionID : 1 ,
@@ -778,9 +793,9 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
778793 {
779794 name : "test one partition is expired and contains block with no compact mark" ,
780795 expectedResult : PartitionedGroupStatus {
781- CanDelete : true ,
782- IsCompleted : false ,
783- DeleteVisitMarker : true ,
796+ CanDelete : true ,
797+ IsCompleted : false ,
798+ VisitMarkersToDelete : [] VisitMarker {} ,
784799 PendingOrFailedPartitions : []Partition {
785800 {
786801 PartitionID : 1 ,
@@ -877,6 +892,10 @@ func TestGetPartitionedGroupStatus(t *testing.T) {
877892 for _ , partition := range result .PendingOrFailedPartitions {
878893 require .Contains (t , tcase .expectedResult .PendingOrFailedPartitions , partition )
879894 }
895+ require .Equal (t , len (tcase .expectedResult .VisitMarkersToDelete ), len (result .VisitMarkersToDelete ))
896+ for _ , visitMarker := range result .VisitMarkersToDelete {
897+ require .Contains (t , tcase .expectedResult .VisitMarkersToDelete , visitMarker )
898+ }
880899 })
881900 }
882901}
0 commit comments