Skip to content

Commit 85740ac

Browse files
authored
test_filter_record_transformer: pass a Time object to Timecop.freeze (fluent#5077)
**Which issue(s) this PR fixes**: Fixes fluent#5041 **What this PR does / why we need it**: I'm investigating fluent#5041 When run the `RecordTransformerFilterTest`, it handles incorrect timestamps. Reproduce: ```ruby @time = event_time('2010-05-04 03:02:01 UTC') Timecop.freeze(@time) logger = Logger.new(STDOUT) p logger.info("Test::RecordTransformerFilterTest setup") ``` Result: ``` I, [1272942121-01-01T00:00:00.000000 #12576] INFO -- : Test::RecordTransformerFilterTest setup ``` We should pass Time object into `Timecop.freeze` **Docs Changes**: Not needed **Release Note**: CI fixes --------- Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
1 parent 308b336 commit 85740ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/plugin/test_filter_record_transformer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class RecordTransformerFilterTest < Test::Unit::TestCase
1414
@tag = 'test.tag'
1515
@tag_parts = @tag.split('.')
1616
@time = event_time('2010-05-04 03:02:01 UTC')
17-
Timecop.freeze(@time)
17+
Timecop.freeze(@time.to_time)
1818
end
1919

2020
teardown do

0 commit comments

Comments
 (0)