clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Integration tests are not run because clickhouse-server does not start in testcontainers

Open mbaksheev opened this issue 1 year ago • 3 comments

Describe the bug

Actually it is not a bug, it is an issue with integration tests.

According to CONTIBUTING.md the integration tests use testcontainers to run clickhouse-server.

When I try to run the integration tests they are failed with error

2024-01-25 16:10:14:046 +0100 [main] ERROR clickhouse/clickhouse-server:latest - Could not start container java.lang.IllegalStateException: Wait strategy failed. Container exited with code 70

The actual problem is that clickhouse-server does not start inside docker and fails with error:

2024.01.25 14:15:40.021419 [ 20 ] {} <Error> RaftInstance: got exception: open: Address family not supported by protocol [system:97] on port 9234
2024.01.25 14:15:40.021583 [ 20 ] {} <Error> void DB::KeeperDispatcher::initialize(const Poco::Util::AbstractConfiguration &, bool, bool, const MultiVersion<Macros>::Version &): Code: 568. DB::Exception: Cannot create interserver listener on port 9234. (RAFT_ERROR), Stack trace (when copying this message, always include the lines below):

This happens because clickhouse-keeper starts in ipv6 mode by default, but in docker ipv6 is disabled by default. Also it's not obvious from the contribution guide that ipv6 support is required to run integration tests.

According to this issue ipv6 can be disabled for clickhouse keeper with option keeper_server.enable_ipv6=false

My question: Does it make sense to change clickhouse-keeper configuration for integration tests and disable ipv6? I can prepare pull request for it if there are no reasons to keep the current behavior.

Steps to reproduce

  1. Run integration tests: mvn clean verify - ipv6 should be disabled in docker (by default)

Expected behavior

Integration tests are run

mbaksheev avatar Jan 25 '24 15:01 mbaksheev

@mbaksheev Can you provide the the machine specs to reproduce?

mzitnik avatar Jan 28 '24 07:01 mzitnik

@mzitnik

HP HP EliteBook 850 G8 Notebook PC
CPU: 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz × 8
--------------------------------------------------------------
OS: Ubuntu 22.04.3 LTS 6.5.0-14-generic
--------------------------------------------------------------
Docker version 24.0.7, build afdd53b
--------------------------------------------------------------
Java which one is set in ~/.m2/toolchains.xml:
java version "17.0.9" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)

I'm not sure what kind of specs you would like to see, please let me know if need to provide something more

mbaksheev avatar Jan 29 '24 12:01 mbaksheev

@mzitnik I found that ipv6 is disabled on my laptop (because of corporate network reasons) and I have no option to enable it (again because of corporate network reasons). What do you thin it is possible to have ipv6 disabled by default like I proposed in PR #1533 since it is more universal approach?

mbaksheev avatar Jan 29 '24 12:01 mbaksheev