Skip to content

test_console_adapter: fix test failures caused by console gem update#5360

Merged
kenhys merged 1 commit into
fluent:masterfrom
Watson1978:test_console_adapter
May 25, 2026
Merged

test_console_adapter: fix test failures caused by console gem update#5360
kenhys merged 1 commit into
fluent:masterfrom
Watson1978:test_console_adapter

Conversation

@Watson1978
Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
The console gem changed its duration log format from 0.0s to 0.00s in version 1.35.0 (socketry/console@14cf37d).

This caused assertion failures in ConsoleAdapterTest when running on newer Ruby versions (3.3+).

This patch will fix following error

$ bundle exec ruby -I"test:lib" test/log/test_console_adapter.rb
Loaded suite test/log/test_console_adapter
Started
F
==========================================================================================================================================
Failure: test_args[debug](ConsoleAdapterTest)
test/log/test_console_adapter.rb:59:in 'ConsoleAdapterTest#test_args'
     56:        fatal: :fatal)
     57:   def test_args(level)
     58:     @console_logger.send(level, "subject", 1, 2, 3)
  => 59:     assert_equal([
     60:                    "#{@timestamp_str} [#{level}]:   0.0s: subject\n" +
     61:                    "      | 1\n" +
     62:                    "      | 2\n" +
<["2023-01-01 15:32:41 +0000 [debug]:   0.0s: subject\n" +
 "      | 1\n" +
 "      | 2\n" +
 "      | 3\n"]> expected but was
<["2023-01-01 15:32:41 +0000 [debug]:  0.00s: subject\n" +
 "      | 1\n" +
 "      | 2\n" +
 "      | 3\n"]>

diff:
? ["2023-01-01 15:32:41 +0000 [debug]:   0.00s: subject\n" +
   "      | 1\n" +
   "      | 2\n" +
   "      | 3\n"]
==========================================================================================================================================
F
...

Docs Changes:

Release Note:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 added CI Test/CI issues backport to v1.19 We will backport this fix to the LTS branch labels May 25, 2026
@Watson1978 Watson1978 requested a review from kenhys May 25, 2026 02:06
Copy link
Copy Markdown
Contributor

@kenhys kenhys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@kenhys kenhys merged commit ddc88db into fluent:master May 25, 2026
21 checks passed
@Watson1978 Watson1978 deleted the test_console_adapter branch May 25, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to v1.19 We will backport this fix to the LTS branch CI Test/CI issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants