spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb fails
Job #1557631405 failed for 0ee68558:
bundle exec rspec spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
1) Gitlab::SidekiqLogging::StructuredLogger#call when the job performs database queries when load balancing is enabled logs the database time
Failure/Error: Sidekiq.logger.info log_job_done(job, started_time, base_payload)
#<Double (anonymous)> received :info with unexpected arguments
expected: ({"args"=>[1234, "hello", {"key"=>"value"}], "class"=>"TestWorker", "completed_at"=>1514808000.0, "cor...e"=>"cronjob:test_queue", "queue_namespace"=>"cronjob", "retry"=>false, "scheduling_latency_s"=>1.0})
got: ({"args"=>[1234, "hello", {"key"=>"value"}], "class"=>"TestWorker", "completed_at"=>1514808000.0, "cor...e"=>"cronjob:test_queue", "queue_namespace"=>"cronjob", "retry"=>false, "scheduling_latency_s"=>1.0})
Diff:
@@ -2,39 +2,36 @@
"class"=>"TestWorker",
"completed_at"=>1514808000.0,
"correlation_id"=>"cid",
- "cpu_s"=>a value >= 0,
+ "cpu_s"=>0.004745,
"created_at"=>1514807999.0,
"db_cached_count"=>0,
- "db_count"=>a value >= 1,
- "db_duration_s"=>a value >= 0.1,
+ "db_count"=>1,
+ "db_duration_s"=>0.102757,
"db_primary_cached_count"=>0,
- "db_primary_count"=>a value >= 1,
- "db_primary_duration_s"=>a value > 0,
+ "db_primary_count"=>1,
+ "db_primary_duration_s"=>0.103,
"db_primary_main_cached_count"=>0,
"db_primary_main_count"=>0,
- "db_primary_main_duration_s"=>0,
+ "db_primary_main_duration_s"=>0.0,
"db_primary_main_wal_cached_count"=>0,
"db_primary_main_wal_count"=>0,
- "db_primary_primary_count"=>a value >= 1,
- "db_primary_primary_duration_s"=>a value > 0,
"db_primary_wal_cached_count"=>0,
"db_primary_wal_count"=>0,
"db_replica_cached_count"=>0,
"db_replica_count"=>0,
- "db_replica_duration_s"=>a value >= 0,
+ "db_replica_duration_s"=>0.0,
"db_replica_main_cached_count"=>0,
"db_replica_main_count"=>0,
- "db_replica_main_duration_s"=>0,
+ "db_replica_main_duration_s"=>0.0,
"db_replica_main_wal_cached_count"=>0,
"db_replica_main_wal_count"=>0,
- "db_replica_primary_count"=>0,
"db_replica_wal_cached_count"=>0,
"db_replica_wal_count"=>0,
"db_write_count"=>0,
"duration_s"=>0.0,
"enqueued_at"=>1514807999.0,
"jid"=>"da883554ee4fe414012f5f42",
- "job_size_bytes"=>be > 0,
+ "job_size_bytes"=>30,
"job_status"=>"done",
"message"=>"TestWorker JID-da883554ee4fe414012f5f42: done: 0.0 sec",
"pid"=>436,
...
Failed examples:
rspec './spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb[1:1:5:2:1]' # Gitlab::SidekiqLogging::StructuredLogger#call when the job performs database queries when load balancing is enabled logs the database time
rspec './spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb[1:1:5:2:2]' # Gitlab::SidekiqLogging::StructuredLogger#call when the job performs database queries when load balancing is enabled prevents database time from leaking to the next job