@@ -68,7 +68,7 @@ func TestInitAndTestConfigDBConnection(t *testing.T) {
68
68
69
69
t .Run ("Check timetable tables" , func (t * testing.T ) {
70
70
var oid int
71
- tableNames := []string {"task" , "chain" , "parameter" , "log" , "execution_log" , "run_status " }
71
+ tableNames := []string {"task" , "chain" , "parameter" , "log" , "execution_log" , "active_session" , "active_chain " }
72
72
for _ , tableName := range tableNames {
73
73
err := pge .ConfigDb .QueryRow (ctx , fmt .Sprintf ("SELECT COALESCE(to_regclass('timetable.%s'), 0) :: int" , tableName )).Scan (& oid )
74
74
assert .NoError (t , err , fmt .Sprintf ("Query for %s existence failed" , tableName ))
@@ -80,8 +80,6 @@ func TestInitAndTestConfigDBConnection(t *testing.T) {
80
80
var oid int
81
81
funcNames := []string {"_validate_json_schema_type(text, jsonb)" ,
82
82
"validate_json_schema(jsonb, jsonb, jsonb)" ,
83
- "get_chain_running_statuses(bigint)" ,
84
- "health_check(TEXT)" ,
85
83
"add_task(timetable.command_kind, TEXT, BIGINT, DOUBLE PRECISION)" ,
86
84
"add_job(TEXT, timetable.cron, TEXT, JSONB, timetable.command_kind, TEXT, INTEGER, BOOLEAN, BOOLEAN, BOOLEAN, BOOLEAN)" ,
87
85
"is_cron_in_time(timetable.cron, timestamptz)" }
@@ -121,7 +119,7 @@ func TestInitAndTestConfigDBConnection(t *testing.T) {
121
119
})
122
120
123
121
t .Run ("Check Reconnecting Database" , func (t * testing.T ) {
124
- assert .Equal (t , true , pge .ReconnectAndFixLeftovers (ctx ),
122
+ assert .Equal (t , true , pge .Reconnect (ctx ),
125
123
"Should succeed for reconnect" )
126
124
})
127
125
}
@@ -140,10 +138,6 @@ func TestSchedulerFunctions(t *testing.T) {
140
138
141
139
ctx := context .Background ()
142
140
143
- t .Run ("Check FixSchedulerCrash function" , func (t * testing.T ) {
144
- assert .NotPanics (t , func () { pge .FixSchedulerCrash (ctx ) }, "Fix scheduler crash failed" )
145
- })
146
-
147
141
t .Run ("Check DeleteChainConfig funсtion" , func (t * testing.T ) {
148
142
assert .Equal (t , false , pge .DeleteChainConfig (ctx , 0 ), "Should not delete in clean database" )
149
143
})
@@ -169,10 +163,10 @@ func TestSchedulerFunctions(t *testing.T) {
169
163
})
170
164
171
165
t .Run ("Check InsertChainRunStatus funсtion" , func (t * testing.T ) {
172
- var id int
173
- assert .NotPanics (t , func () { id = pge .InsertChainRunStatus (ctx , 0 ) },
166
+ var res bool
167
+ assert .NotPanics (t , func () { res = pge .InsertChainRunStatus (ctx , 0 , 1 ) },
174
168
"Should no error in clean database" )
175
- assert .NotZero (t , id , "Run status id should be greater then 0 " )
169
+ assert .True (t , res , "Active chain should be inserted " )
176
170
})
177
171
178
172
t .Run ("Check ExecuteSQLCommand function" , func (t * testing.T ) {
0 commit comments