Review testRerunAtStartup as it sometimes fails
log:
```
2024-03-07T18:09:53+0000 warning testRerunAtStartup() : [PostgresNIO] Trying to lease connection from `PostgresClient`, but `PostgresClient.run()` hasn't been called yet.
2024-03-07T18:09:53+0000 debug testRerunAtStartup() : sl-cancellationSignals=[] sl-gracefulShutdownSignals=[SIGTERM, SIGINT] sl-services=[HummingbirdPostgresTests.PostgresClientService(client: PostgresNIO.PostgresClient), HummingbirdJobs.HBJobQueue<HummingbirdJobsPostgres.HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function)))] [ServiceLifecycle] Starting service lifecycle
2024-03-07T18:09:53+0000 debug testRerunAtStartup() : sl-service=PostgresClientService(client: PostgresNIO.PostgresClient) [ServiceLifecycle] Starting service
2024-03-07T18:09:53+0000 debug testRerunAtStartup() : sl-service=HBJobQueue<HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function))) [ServiceLifecycle] Starting service
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Waiting for JobQueue migrations
2024-03-07T18:09:53+0000 debug testRerunAtStartup() : psql_connection_id=0 [PostgresNIO] Creating new connection
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdPostgres] Reverting _Create_JobQueue_Table_ from group _hb_jobqueue
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdPostgres] Reverting _Create_Jobs_Table_ from group _hb_jobqueue
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdPostgres] Migrating _Create_Jobs_Table_ from group _hb_jobqueue
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdPostgres] Migrating _Create_JobQueue_Table_ from group _hb_jobqueue
2024-03-07T18:09:53+0000 debug testRerunAtStartup() : psql_connection_id=1 [PostgresNIO] Creating new connection
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Update Jobs at initialization
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Moving 0 jobs with status: processing to job queue
2024-03-07T18:09:53+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Moving 0 jobs with status: failed to job queue
/__w/hummingbird-postgres/hummingbird-postgres/Tests/HummingbirdPostgresTests/JobsTests.swift:38: error: JobsTests.testRerunAtStartup : Asynchronous wait failed - Exceeded timeout of 10.0 seconds, with unfulfilled expectations: TestJob failed
/__w/hummingbird-postgres/hummingbird-postgres/Tests/HummingbirdPostgresTests/JobsTests.swift:299: error: JobsTests.testRerunAtStartup : XCTAssertFalse failed -
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : [ServiceLifecycle] Graceful shutdown caught. Cascading shutdown to services
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-service=HBJobQueue<HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function))) [ServiceLifecycle] Triggering graceful shutdown for service
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-service=HBJobQueue<HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function))) [ServiceLifecycle] Service finished
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-service=PostgresClientService(client: PostgresNIO.PostgresClient) [ServiceLifecycle] Triggering graceful shutdown for service
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=0 [PostgresNIO] Close connection
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=1 [PostgresNIO] Close connection
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=0 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=1 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=0 [PostgresNIO] Connection closed
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=1 [PostgresNIO] Connection closed
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-service=PostgresClientService(client: PostgresNIO.PostgresClient) [ServiceLifecycle] Service finished
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : [ServiceLifecycle] Service lifecycle ended
2024-03-07T18:10:03+0000 warning testRerunAtStartup() : [PostgresNIO] Trying to lease connection from `PostgresClient`, but `PostgresClient.run()` hasn't been called yet.
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-cancellationSignals=[] sl-gracefulShutdownSignals=[SIGTERM, SIGINT] sl-services=[HummingbirdPostgresTests.PostgresClientService(client: PostgresNIO.PostgresClient), HummingbirdJobs.HBJobQueue<HummingbirdJobsPostgres.HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function)))] [ServiceLifecycle] Starting service lifecycle
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-service=PostgresClientService(client: PostgresNIO.PostgresClient) [ServiceLifecycle] Starting service
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : sl-service=HBJobQueue<HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function))) [ServiceLifecycle] Starting service
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=0 [PostgresNIO] Creating new connection
2024-03-07T18:10:03+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Waiting for JobQueue migrations
2024-03-07T18:10:03+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Update Jobs at initialization
2024-03-07T18:10:03+0000 debug testRerunAtStartup() : psql_connection_id=1 [PostgresNIO] Creating new connection
2024-03-07T18:10:03+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Moving 0 jobs with status: processing to job queue
2024-03-07T18:10:03+0000 info testRerunAtStartup() : [HummingbirdJobsPostgres] Moving 0 jobs with status: failed to job queue
/__w/hummingbird-postgres/hummingbird-postgres/Tests/HummingbirdPostgresTests/JobsTests.swift:38: error: JobsTests.testRerunAtStartup : Asynchronous wait failed - Exceeded timeout of 10.0 seconds, with unfulfilled expectations: TestJob2 succeeded
/__w/hummingbird-postgres/hummingbird-postgres/Tests/HummingbirdPostgresTests/JobsTests.swift:307: error: JobsTests.testRerunAtStartup : XCTAssertTrue failed -
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : [ServiceLifecycle] Graceful shutdown caught. Cascading shutdown to services
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : sl-service=HBJobQueue<HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function))) [ServiceLifecycle] Triggering graceful shutdown for service
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : sl-service=HBJobQueue<HBPostgresQueue>(queue: HummingbirdJobsPostgres.HBPostgresQueue, handler: HBJobQueueHandler<HBPostgresQueue>, allocator: NIOCore.ByteBufferAllocator(malloc: (Function), realloc: (Function), free: (Function), memcpy: (Function))) [ServiceLifecycle] Service finished
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : sl-service=PostgresClientService(client: PostgresNIO.PostgresClient) [ServiceLifecycle] Triggering graceful shutdown for service
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : psql_connection_id=0 [PostgresNIO] Close connection
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : psql_connection_id=1 [PostgresNIO] Close connection
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : psql_connection_id=0 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : psql_connection_id=1 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : psql_connection_id=1 [PostgresNIO] Connection closed
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : psql_connection_id=0 [PostgresNIO] Connection closed
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : sl-service=PostgresClientService(client: PostgresNIO.PostgresClient) [ServiceLifecycle] Service finished
2024-03-07T18:10:13+0000 debug testRerunAtStartup() : [ServiceLifecycle] Service lifecycle ended
Test Case 'JobsTests.testRerunAtStartup' failed (20.251 seconds)
```
关闭于 2024-09-13 2 条评论