Skip to content

Backport(v1.19): test_console_adapter: fix test failures caused by console gem update (#5360)#5366

Merged
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5360
May 31, 2026
Merged

Backport(v1.19): test_console_adapter: fix test failures caused by console gem update (#5360)#5366
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5360

Conversation

@github-actions
Copy link
Copy Markdown

Which issue(s) this PR fixes:
Backport #5360
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:

…5360)

**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>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@Watson1978 Watson1978 merged commit 9130c61 into v1.19 May 31, 2026
1 check passed
@Watson1978 Watson1978 deleted the backport-to-v1.19/pr5360 branch May 31, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant