File tree Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -729,11 +729,10 @@ def resume(
729
729
max_num_splits = max_num_splits ,
730
730
max_log_size = max_log_size * 1024 * 1024 ,
731
731
)
732
+ write_run_id (run_id_file , runtime .run_id )
732
733
runtime .persist_constants ()
733
734
runtime .execute ()
734
735
735
- write_run_id (run_id_file , runtime .run_id )
736
-
737
736
738
737
@parameters .add_custom_parameters (deploy_mode = True )
739
738
@cli .command (help = "Run the workflow locally." )
Original file line number Diff line number Diff line change 92
92
" NestedUnboundedForeachTest" ,
93
93
" DetectSegFaultTest" ,
94
94
" TimeoutDecoratorTest" ,
95
- " CardExtensionsImportTest"
95
+ " CardExtensionsImportTest" ,
96
+ " RunIdFileTest"
96
97
]
97
98
},
98
99
{
128
129
" NestedUnboundedForeachTest" ,
129
130
" DetectSegFaultTest" ,
130
131
" TimeoutDecoratorTest" ,
131
- " CardExtensionsImportTest"
132
+ " CardExtensionsImportTest" ,
133
+ " RunIdFileTest"
132
134
]
133
135
}
134
136
],
Original file line number Diff line number Diff line change
1
+ from metaflow_test import MetaflowTest , ExpectationFailed , steps
2
+
3
+
4
+ class RunIdFileTest (MetaflowTest ):
5
+ """
6
+ Resuming and initial running of a flow should write run id file early (prior to execution)
7
+ """
8
+
9
+ RESUME = True
10
+ PRIORITY = 3
11
+
12
+ @steps (0 , ["singleton-start" ], required = True )
13
+ def step_start (self ):
14
+ import os
15
+ from metaflow import current
16
+
17
+ # Whether we are in "run" or "resume" mode, --run-id-file must be written prior to execution
18
+ assert os .path .isfile (
19
+ "run-id"
20
+ ), "run id file should exist before resume execution"
21
+ with open ("run-id" , "r" ) as f :
22
+ run_id_from_file = f .read ()
23
+ assert run_id_from_file == current .run_id
24
+
25
+ # Test both regular run and resume paths
26
+ if not is_resumed ():
27
+ raise ResumeFromHere ()
28
+
29
+ @steps (2 , ["all" ])
30
+ def step_all (self ):
31
+ pass
32
+
33
+ def check_results (self , flow , checker ):
34
+ pass
You can’t perform that action at this time.
0 commit comments