@@ -52,30 +52,33 @@ func TestSealingOnShutdown(t *testing.T) {
5252 cfg .MinSealFracSize = 0 // to ensure that the frac will not be sealed on shutdown
5353 cfg , fm , stop := setupFracManager (t , cfg )
5454 appendDocsToFracManager (t , fm , 10 )
55- activeName := fm .Fractions ()[0 ].Info ().Name ()
55+
56+ fractions := fm .lc .registry .all .fractions
57+ activeName := fractions [0 ].Info ().Name ()
58+
5659 stop ()
5760
5861 // second start
5962 cfg .MinSealFracSize = 1 // to ensure that the frac will be sealed on shutdown
6063 cfg , fm , stop = setupFracManager (t , cfg )
6164
62- assert .Equal (t , 1 , len (fm .Fractions ()), "should have one fraction" )
63- assert .Equal (t , activeName , fm .Fractions ()[0 ].Info ().Name (), "fraction should have the same name" )
64- _ , ok := fm .Fractions ()[0 ].(* fractionProxy ).impl .(* frac.Active )
65+ fractions = fm .lc .registry .all .fractions
66+ assert .Equal (t , 1 , len (fractions ), "should have one fraction" )
67+ assert .Equal (t , activeName , fractions [0 ].Info ().Name (), "fraction should have the same name" )
68+ _ , ok := fractions [0 ].(* frac.Active )
6569 assert .True (t , ok , "fraction should be active" )
66-
6770 stop ()
6871
6972 // third start
7073 _ , fm , stop = setupFracManager (t , cfg )
7174
72- assert .Equal (t , 2 , len (fm .Fractions ()), "should have 2 fraction: new active and old sealed" )
73- _ , ok = fm .Fractions ()[0 ].(* fractionProxy ).impl .(* frac.Sealed )
75+ fractions = fm .lc .registry .all .fractions
76+ assert .Equal (t , 2 , len (fractions ), "should have 2 fraction: new active and old sealed" )
77+ _ , ok = fractions [0 ].(* frac.Sealed )
7478 assert .True (t , ok , "first fraction should be sealed" )
75- assert .Equal (t , activeName , fm . Fractions () [0 ].Info ().Name (), "sealed fraction should have the same name" )
76- assert .Equal (t , uint32 (0 ), fm . Fractions () [1 ].Info ().DocsTotal , "active fraction should be empty" )
77- _ , ok = fm . Fractions () [1 ].( * fractionProxy ). impl .(* frac.Active )
79+ assert .Equal (t , activeName , fractions [0 ].Info ().Name (), "sealed fraction should have the same name" )
80+ assert .Equal (t , uint32 (0 ), fractions [1 ].Info ().DocsTotal , "active fraction should be empty" )
81+ _ , ok = fractions [1 ].(* frac.Active )
7882 assert .True (t , ok , "new fraction should be active" )
79-
8083 stop ()
8184}
0 commit comments