@@ -2914,20 +2914,11 @@ func TestStore_GC(t *testing.T) {
2914
2914
generateManifest (descs [0 ], & descs [13 ], descs [1 ]) // Blob 16, referrer of a garbage manifest
2915
2915
2916
2916
// push blobs 0 - blobs 10 into s
2917
- eg , egCtx := errgroup .WithContext (ctx )
2918
2917
for i := 0 ; i <= 10 ; i ++ {
2919
- eg .Go (func (i int ) func () error {
2920
- return func () error {
2921
- err := s .Push (egCtx , descs [i ], bytes .NewReader (blobs [i ]))
2922
- if err != nil {
2923
- return fmt .Errorf ("failed to push test content to src: %d: %v" , i , err )
2924
- }
2925
- return nil
2926
- }
2927
- }(i ))
2928
- }
2929
- if err := eg .Wait (); err != nil {
2930
- t .Fatal (err )
2918
+ err := s .Push (ctx , descs [i ], bytes .NewReader (blobs [i ]))
2919
+ if err != nil {
2920
+ t .Errorf ("failed to push test content to src: %d: %v" , i , err )
2921
+ }
2931
2922
}
2932
2923
2933
2924
// remove blobs 4 - blobs 10 from index.json
@@ -2939,23 +2930,15 @@ func TestStore_GC(t *testing.T) {
2939
2930
// push blobs 11 - blobs 16 into s.storage, making them garbage as their metadata
2940
2931
// doesn't exist in s
2941
2932
for i := 11 ; i < len (blobs ); i ++ {
2942
- eg .Go (func (i int ) func () error {
2943
- return func () error {
2944
- err := s .storage .Push (egCtx , descs [i ], bytes .NewReader (blobs [i ]))
2945
- if err != nil {
2946
- return fmt .Errorf ("failed to push test content to src: %d: %v" , i , err )
2947
- }
2948
- return nil
2949
- }
2950
- }(i ))
2951
- }
2952
- if err := eg .Wait (); err != nil {
2953
- t .Fatal (err )
2933
+ err := s .storage .Push (ctx , descs [i ], bytes .NewReader (blobs [i ]))
2934
+ if err != nil {
2935
+ t .Errorf ("failed to push test content to src: %d: %v" , i , err )
2936
+ }
2954
2937
}
2955
2938
2956
2939
// confirm that all the blobs are in the storage
2957
2940
for i := 11 ; i < len (blobs ); i ++ {
2958
- exists , err := s .Exists (egCtx , descs [i ])
2941
+ exists , err := s .Exists (ctx , descs [i ])
2959
2942
if err != nil {
2960
2943
t .Fatal (err )
2961
2944
}
@@ -2965,14 +2948,14 @@ func TestStore_GC(t *testing.T) {
2965
2948
}
2966
2949
2967
2950
// perform GC
2968
- if err = s .GC (egCtx ); err != nil {
2951
+ if err = s .GC (ctx ); err != nil {
2969
2952
t .Fatal (err )
2970
2953
}
2971
2954
2972
2955
// verify existence
2973
2956
wantExistence := []bool {true , true , false , true , true , false , false , false , false , false , false , false , false , false , false , false , false }
2974
2957
for i , wantValue := range wantExistence {
2975
- exists , err := s .Exists (egCtx , descs [i ])
2958
+ exists , err := s .Exists (ctx , descs [i ])
2976
2959
if err != nil {
2977
2960
t .Fatal (err )
2978
2961
}
0 commit comments