From 992f689a1f980967c3d5ed933987ee1c65b79b45 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Mon, 2 Nov 2026 10:42:43 +0900 Subject: [PATCH] test_inject: fix localtime tests that depend on the current daylight saving time The expected values used the current UTC offset, but the tests format a time on 2016-06-21. In a time zone with daylight saving time, the two offsets differ for half of the year. The windows-11-arm runner uses Pacific time while the other runners use UTC (actions/runner-images#15007), so its jobs fail since daylight saving time ended in the US on 2026-11-01. Use the UTC offset of the test date instead. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Shizuo Fujita --- test/plugin_helper/test_inject.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/plugin_helper/test_inject.rb b/test/plugin_helper/test_inject.rb index b17f63f5eb..6621bfb37e 100644 --- a/test/plugin_helper/test_inject.rb +++ b/test/plugin_helper/test_inject.rb @@ -232,7 +232,7 @@ def config_inject_section(hash = {}) end test 'injects time as formatted string in localtime if timezone not specified' do - local_timezone = Time.now.strftime('%z') + local_timezone = Time.local(2016, 6, 21, 8, 10, 11).strftime('%z') time_in_unix = Time.parse("2016-06-21 08:10:11 #{local_timezone}").to_i time_subsecond = 320_101_224 time = Fluent::EventTime.new(time_in_unix, time_subsecond) @@ -245,7 +245,7 @@ def config_inject_section(hash = {}) end test 'injects time as formatted string with nanosecond in localtime if timezone not specified' do - local_timezone = Time.now.strftime('%z') + local_timezone = Time.local(2016, 6, 21, 8, 10, 11).strftime('%z') time_in_unix = Time.parse("2016-06-21 08:10:11 #{local_timezone}").to_i time_subsecond = 320_101_224 time = Fluent::EventTime.new(time_in_unix, time_subsecond) @@ -258,7 +258,7 @@ def config_inject_section(hash = {}) end test 'injects time as formatted string with millisecond in localtime if timezone not specified' do - local_timezone = Time.now.strftime('%z') + local_timezone = Time.local(2016, 6, 21, 8, 10, 11).strftime('%z') time_in_unix = Time.parse("2016-06-21 08:10:11 #{local_timezone}").to_i time_subsecond = 320_101_224 time = Fluent::EventTime.new(time_in_unix, time_subsecond)