@@ -69,45 +69,44 @@ func TestTestPlanner(t *testing.T) {
6969
7070 plan , err := mvt .plan ()
7171 require .NoError (t , err )
72- require .Len (t , plan .steps , 11 )
72+ require .Len (t , plan .steps , 10 )
7373
7474 // Assert on the pretty-printed version of the test plan as that
7575 // asserts the ordering of the steps we want to take, and as a bonus
7676 // tests the printing function itself.
7777 expectedPrettyPlan := fmt .Sprintf (`
7878mixed-version test plan for upgrading from %[1]s to <current>:
7979├── starting cluster at version "%[1]s" (1)
80- ├── upload current binary to all cockroach nodes (:1-4) (2)
81- ├── wait for nodes :1-4 to all have the same cluster version (same as binary version of node 1) (3)
82- ├── preventing auto-upgrades by setting ` + "`preserve_downgrade_option`" + ` (4)
83- ├── run "initialize bank workload" (5)
80+ ├── wait for nodes :1-4 to all have the same cluster version (same as binary version of node 1) (2)
81+ ├── preventing auto-upgrades by setting ` + "`preserve_downgrade_option`" + ` (3)
82+ ├── run "initialize bank workload" (4)
8483├── start background hooks concurrently
85- │ ├── run "bank workload", after 50ms delay (6 )
86- │ ├── run "rand workload", after 200ms delay (7 )
87- │ └── run "csv server", after 500ms delay (8 )
84+ │ ├── run "bank workload", after 50ms delay (5 )
85+ │ ├── run "rand workload", after 200ms delay (6 )
86+ │ └── run "csv server", after 500ms delay (7 )
8887├── upgrade nodes :1-4 from "%[1]s" to "<current>"
89- │ ├── restart node 1 with binary version <current> (9 )
90- │ ├── run "mixed-version 1" (10 )
91- │ ├── restart node 4 with binary version <current> (11 )
92- │ ├── restart node 3 with binary version <current> (12 )
93- │ ├── run "mixed-version 2" (13 )
94- │ └── restart node 2 with binary version <current> (14 )
88+ │ ├── restart node 1 with binary version <current> (8 )
89+ │ ├── run "mixed-version 1" (9 )
90+ │ ├── restart node 4 with binary version <current> (10 )
91+ │ ├── restart node 3 with binary version <current> (11 )
92+ │ ├── run "mixed-version 2" (12 )
93+ │ └── restart node 2 with binary version <current> (13 )
9594├── downgrade nodes :1-4 from "<current>" to "%[1]s"
96- │ ├── restart node 4 with binary version %[1]s (15 )
97- │ ├── run "mixed-version 2" (16 )
98- │ ├── restart node 2 with binary version %[1]s (17 )
99- │ ├── restart node 3 with binary version %[1]s (18 )
100- │ ├── restart node 1 with binary version %[1]s (19 )
101- │ └── run "mixed-version 1" (20 )
95+ │ ├── restart node 4 with binary version %[1]s (14 )
96+ │ ├── run "mixed-version 2" (15 )
97+ │ ├── restart node 2 with binary version %[1]s (16 )
98+ │ ├── restart node 3 with binary version %[1]s (17 )
99+ │ ├── restart node 1 with binary version %[1]s (18 )
100+ │ └── run "mixed-version 1" (19 )
102101├── upgrade nodes :1-4 from "%[1]s" to "<current>"
103- │ ├── restart node 4 with binary version <current> (21 )
104- │ ├── run "mixed-version 1" (22 )
105- │ ├── restart node 1 with binary version <current> (23 )
106- │ ├── restart node 2 with binary version <current> (24 )
107- │ ├── run "mixed-version 2" (25 )
108- │ └── restart node 3 with binary version <current> (26 )
109- ├── finalize upgrade by resetting ` + "`preserve_downgrade_option`" + ` (27 )
110- └── wait for nodes :1-4 to all have the same cluster version (same as binary version of node 1) (28 )
102+ │ ├── restart node 4 with binary version <current> (20 )
103+ │ ├── run "mixed-version 1" (21 )
104+ │ ├── restart node 1 with binary version <current> (22 )
105+ │ ├── restart node 2 with binary version <current> (23 )
106+ │ ├── run "mixed-version 2" (24 )
107+ │ └── restart node 3 with binary version <current> (25 )
108+ ├── finalize upgrade by resetting ` + "`preserve_downgrade_option`" + ` (26 )
109+ └── wait for nodes :1-4 to all have the same cluster version (same as binary version of node 1) (27 )
111110` , predecessorVersion )
112111
113112 expectedPrettyPlan = expectedPrettyPlan [1 :] // remove leading newline
@@ -121,7 +120,7 @@ mixed-version test plan for upgrading from %[1]s to <current>:
121120 mvt .OnStartup ("startup 2" , dummyHook )
122121 plan , err = mvt .plan ()
123122 require .NoError (t , err )
124- requireConcurrentHooks (t , plan .steps [4 ], "startup 1" , "startup 2" )
123+ requireConcurrentHooks (t , plan .steps [3 ], "startup 1" , "startup 2" )
125124
126125 // Assert that AfterUpgradeFinalized hooks are scheduled to run in
127126 // the last step of the test.
@@ -131,8 +130,8 @@ mixed-version test plan for upgrading from %[1]s to <current>:
131130 mvt .AfterUpgradeFinalized ("finalizer 3" , dummyHook )
132131 plan , err = mvt .plan ()
133132 require .NoError (t , err )
134- require .Len (t , plan .steps , 10 )
135- requireConcurrentHooks (t , plan .steps [9 ], "finalizer 1" , "finalizer 2" , "finalizer 3" )
133+ require .Len (t , plan .steps , 9 )
134+ requireConcurrentHooks (t , plan .steps [8 ], "finalizer 1" , "finalizer 2" , "finalizer 3" )
136135}
137136
138137// TestDeterministicTestPlan tests that generating a test plan with
@@ -199,15 +198,15 @@ func TestDeterministicHookSeeds(t *testing.T) {
199198
200199 // We can hardcode these paths since we are using a fixed seed in
201200 // these tests.
202- firstRun := plan .steps [4 ].(sequentialRunStep ).steps [4 ].(runHookStep )
201+ firstRun := plan .steps [3 ].(sequentialRunStep ).steps [4 ].(runHookStep )
203202 require .Equal (t , "do something" , firstRun .hook .name )
204203 require .NoError (t , firstRun .Run (ctx , nilLogger , nilCluster , emptyHelper ))
205204
206- secondRun := plan .steps [5 ].(sequentialRunStep ).steps [1 ].(runHookStep )
205+ secondRun := plan .steps [4 ].(sequentialRunStep ).steps [1 ].(runHookStep )
207206 require .Equal (t , "do something" , secondRun .hook .name )
208207 require .NoError (t , secondRun .Run (ctx , nilLogger , nilCluster , emptyHelper ))
209208
210- thirdRun := plan .steps [6 ].(sequentialRunStep ).steps [3 ].(runHookStep )
209+ thirdRun := plan .steps [5 ].(sequentialRunStep ).steps [3 ].(runHookStep )
211210 require .Equal (t , "do something" , thirdRun .hook .name )
212211 require .NoError (t , thirdRun .Run (ctx , nilLogger , nilCluster , emptyHelper ))
213212
0 commit comments