File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change 16
16
17
17
"""Tests for the backend method of workflow_state"""
18
18
19
-
20
- from asyncio import sleep
21
19
import pytest
22
- from textwrap import dedent
23
20
24
21
from cylc .flow .dbstatecheck import CylcWorkflowDBChecker
25
22
from cylc .flow .scheduler import Scheduler
@@ -36,13 +33,15 @@ async def checker(
36
33
"""
37
34
wid = mod_flow ({
38
35
'scheduling' : {
39
- 'graph' : {'P1Y' : dedent ('''
40
- good:succeeded
41
- bad:failed?
42
- output:custom_output
43
- ''' )},
44
36
'initial cycle point' : '1000' ,
45
- 'final cycle point' : '1001'
37
+ 'final cycle point' : '1001' ,
38
+ 'graph' : {
39
+ 'P1Y' : '''
40
+ good:succeeded
41
+ bad:failed?
42
+ output:custom_output
43
+ '''
44
+ },
46
45
},
47
46
'runtime' : {
48
47
'bad' : {'simulation' : {'fail cycle points' : '1000' }},
@@ -51,11 +50,17 @@ async def checker(
51
50
})
52
51
schd : Scheduler = mod_scheduler (wid , paused_start = False )
53
52
async with mod_run (schd ):
53
+ # allow a cycle of the main loop to pass so that flow 2 can be
54
+ # added to db
54
55
await mod_complete (schd )
56
+
57
+ # trigger a new task in flow 2
55
58
schd .pool .force_trigger_tasks (['1000/good' ], ['2' ])
56
- # Allow a cycle of the main loop to pass so that flow 2 can be
57
- # added to db
58
- await sleep (1 )
59
+
60
+ # update the database
61
+ schd .process_workflow_db_queue ()
62
+
63
+ # yield a DB checker
59
64
with CylcWorkflowDBChecker (
60
65
'somestring' , 'utterbunkum' , schd .workflow_db_mgr .pub_path
61
66
) as _checker :
You can’t perform that action at this time.
0 commit comments