@@ -136,17 +136,17 @@ mod tests {
136
136
let main_db_connection = main_db_file_connection ( & main_db_path) . unwrap ( ) ;
137
137
let cardano_tx_connection = cardano_tx_db_file_connection ( & ctx_db_path) . unwrap ( ) ;
138
138
139
- let service = AggregatorUpkeepService :: new (
140
- Arc :: new ( main_db_connection) ,
141
- Arc :: new ( SqliteConnectionPool :: build_from_connection (
142
- cardano_tx_connection,
143
- ) ) ,
144
- Arc :: new ( SignedEntityTypeLock :: default ( ) ) ,
145
- TestLogger :: file ( & log_path) ,
146
- ) ;
147
-
148
- // Separate block to ensure the log is flushed after run
139
+ // Separate block to force log flushing by dropping the service that owns the logger
149
140
{
141
+ let service = AggregatorUpkeepService :: new (
142
+ Arc :: new ( main_db_connection) ,
143
+ Arc :: new ( SqliteConnectionPool :: build_from_connection (
144
+ cardano_tx_connection,
145
+ ) ) ,
146
+ Arc :: new ( SignedEntityTypeLock :: default ( ) ) ,
147
+ TestLogger :: file ( & log_path) ,
148
+ ) ;
149
+
150
150
service. run ( ) . await . expect ( "Upkeep service failed" ) ;
151
151
}
152
152
@@ -175,18 +175,18 @@ mod tests {
175
175
. join ( "upkeep.log" ) ;
176
176
177
177
let signed_entity_type_lock = Arc :: new ( SignedEntityTypeLock :: default ( ) ) ;
178
- let service = AggregatorUpkeepService :: new (
179
- Arc :: new ( main_db_connection ( ) . unwrap ( ) ) ,
180
- Arc :: new ( SqliteConnectionPool :: build ( 1 , cardano_tx_db_connection) . unwrap ( ) ) ,
181
- signed_entity_type_lock. clone ( ) ,
182
- TestLogger :: file ( & log_path) ,
183
- ) ;
178
+ signed_entity_type_lock
179
+ . lock ( SignedEntityTypeDiscriminants :: CardanoTransactions )
180
+ . await ;
184
181
185
- // Separate block to ensure the log is flushed after run
182
+ // Separate block to force log flushing by dropping the service that owns the logger
186
183
{
187
- signed_entity_type_lock
188
- . lock ( SignedEntityTypeDiscriminants :: CardanoTransactions )
189
- . await ;
184
+ let service = AggregatorUpkeepService :: new (
185
+ Arc :: new ( main_db_connection ( ) . unwrap ( ) ) ,
186
+ Arc :: new ( SqliteConnectionPool :: build ( 1 , cardano_tx_db_connection) . unwrap ( ) ) ,
187
+ signed_entity_type_lock. clone ( ) ,
188
+ TestLogger :: file ( & log_path) ,
189
+ ) ;
190
190
service. run ( ) . await . expect ( "Upkeep service failed" ) ;
191
191
}
192
192
0 commit comments