Commit Graph

205 Commits

Author SHA1 Message Date
Azat Khuzhin
09b782a52e Increase default wait of the server start in clickhouse-test
Set --server-check-retries to 90 (and this is ~45 seconds), since right
now sometimes it is not enough [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/30191/0e34a9d550cfe6924fe575871f36c44dd44acdaa/functional_stateless_tests_(memory).html#fail1

And the reason I guess is clickhouse-test had been rewritten to
http.client in #30065, and since now it does not need to execute
clickhouse-client binary, which in debug/sanitizers builds can take also
sometime.
That said that with clickhouse-client for hung check it was not 15
seconds, but more (each clickhouse-client requires 0.6sec with
sanitizers for simple SELECT 1, while w/o 0.1second, also too much
should be optimized)
2021-10-18 10:46:02 +03:00
Azat Khuzhin
612a21cc97 clickhouse-test: do not propagate CLICKHOUSE_PORT_HTTP to clickhouse-client 2021-10-16 17:59:56 +03:00
Azat Khuzhin
c6e61e9497 clickhouse-test: use splitlines() over split('\n') 2021-10-16 17:59:56 +03:00
Azat Khuzhin
3102d24872 Fix --hung-check in clickhouse-test
JSONEachRow cannot be parsed with a simple json.loads(), instead it
should be passed to json.loads() line by line.

Fixes: #30065
2021-10-16 17:59:56 +03:00
Azat Khuzhin
e5bc573250 clickhouse-test: fix hung check in stress test by using system database 2021-10-13 00:19:16 +03:00
Azat Khuzhin
8d7798fa2e clickhouse-test: do not guard CREATE DATABASE with try/catch
Since it will not configure testcase args and fail eventually, and later
we have a try/catch anyway, this should be enough.
2021-10-12 22:39:43 +03:00
Azat Khuzhin
40d210367f clickhouse-test: fix catching of timeouts 2021-10-12 22:33:41 +03:00
Azat Khuzhin
427c428a27 clickhouse-test: process some options regardless --client 2021-10-12 22:30:34 +03:00
Azat Khuzhin
8dc8674298 clickhouse-test: process --client-option 2021-10-12 22:30:16 +03:00
Azat Khuzhin
fe90c979b5 clickhouse-test: fix redirect to stderr
Before #29856 `CREATE DATABASE` overwrites it.

Reported-by: @amosbird
2021-10-12 22:18:39 +03:00
Azat Khuzhin
50b95bd89d clickhouse-test: passthrough log_comment for DROP DATABASE too 2021-10-12 21:09:48 +03:00
Azat Khuzhin
e2e62ce273 clickhouse-test: replace clickhouse-driver with http interface (via http.client)
Cons of clickhouse-driver:
- it is one more extra dependency
- it does not have correct timeouts (only for socket operations, and
  this is not the same, so we need to set timeout by ourself)
- it is one more thing which can break (@alesapin)
2021-10-12 21:08:33 +03:00
alesapin
3ae960e04b Review fixes 2021-10-11 16:40:12 +03:00
alesapin
59a78830f9 Better timeouts in clickhouse-test 2021-10-11 14:46:01 +03:00
Azat Khuzhin
42ca2b4bb2 clickhouse-test: remove not existing options for pylint
https://clickhouse-test-reports.s3.yandex.net/29856/e2d6698244d43979b3fe2478dfdcd8dc3a91a0fd/style_check/test_run.txt.out.log
2021-10-09 01:43:00 +03:00
Azat Khuzhin
5d6da023bb clickhouse-test: fix hung check under stress tests
https://clickhouse-test-reports.s3.yandex.net/29856/e2d6698244d43979b3fe2478dfdcd8dc3a91a0fd/stress_test_(address).html#fail1
2021-10-09 01:42:08 +03:00
Azat Khuzhin
e2d6698244 clickhouse-test: do not use persistent connection for simplicity (due to threads) 2021-10-08 00:09:37 +03:00
Azat Khuzhin
df129d7efc Rewrite clickhouse-test to use python clickhouse_driver
Pros:
- Using native protocol over executing binaries is always better
- `clickhouse-client` in debug build takes almost a second to execute simple `SELECT 1`
  and `clickhouse-test` requires ~5 queries at start (determine some
  flags, zk, alive, create database)

Notes:
- `FORMAT Vertical` had been replaced with printing of `pandas.DataFrame`

And after this patch tiny tests work with the speed of the test, and
does not requires +-5 seconds of bootstrapping.
2021-10-08 00:09:37 +03:00
Azat Khuzhin
9dd0fca1ed Suppress some existed warnings in clickhouse-test (will be fixed separately) 2021-10-08 00:09:37 +03:00
tavplubix
75be60ff22
Merge pull request #29452 from azat/clickhouse-test-fix-term
clickhouse-test: fix shared list object (by fixing manager lifetime)
2021-09-28 22:34:21 +03:00
Azat Khuzhin
985e8ee061 clickhouse-test: fix shared list object (by fixing manager lifetime)
Right now it is possible to get the following error:

    Having 20 errors! 0 tests passed. 0 tests skipped. 57.37 s elapsed (MainProcess).
    Won't run stateful tests because test data wasn't loaded.
    Traceback (most recent call last):
      File "/usr/lib/python3.9/multiprocessing/managers.py", line 802, in _callmethod
        conn = self._tls.connection
    AttributeError: 'ForkAwareLocal' object has no attribute 'connection'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/src/ch/clickhouse/.cmake/../tests/clickhouse-test", line 1462, in <module>
        main(args)
      File "/src/ch/clickhouse/.cmake/../tests/clickhouse-test", line 1261, in main
        if len(restarted_tests) > 0:
      File "<string>", line 2, in __len__
      File "/usr/lib/python3.9/multiprocessing/managers.py", line 806, in _callmethod
        self._connect()
      File "/usr/lib/python3.9/multiprocessing/managers.py", line 793, in _connect
        conn = self._Client(self._token.address, authkey=self._authkey)
      File "/usr/lib/python3.9/multiprocessing/connection.py", line 507, in Client
        c = SocketClient(address)
      File "/usr/lib/python3.9/multiprocessing/connection.py", line 635, in SocketClient
        s.connect(address)
    ConnectionRefusedError: [Errno 111] Connection refused

The reason behind this is that manager's thread got terminated:

    ipdb> p restarted_tests._manager._process
    <ForkProcess name='SyncManager-1' pid=25125 parent=24939 stopped exitcode=-SIGTERM>

Refs: #29259 (cc: @vdimir)
Follow-up for: #29197 (cc: @tavplubix)
2021-09-27 21:10:59 +03:00
Azat Khuzhin
8be6a59e65 clickhouse-test: fix long tag check for flaky check (--test-runs > 1)
Otherwise it will mark the test as failed, like in [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/29369/2320be204397bbb9f9a673cf093b7967fd37a107/functional_stateless_tests_flaky_check_(address).html#fail1

Follow-up for: #28909 (Cc: @vitlibar)
2021-09-27 21:10:14 +03:00
tavplubix
1c9778603f
Update clickhouse-test 2021-09-27 11:43:00 +03:00
Vladimir C
c83e2f6fd4
Merge pull request #29259 from vdimir/test-global-multiproc-fix 2021-09-22 17:47:08 +03:00
tavplubix
7712d0e9df
Update clickhouse-test 2021-09-22 16:17:51 +03:00
vdimir
3a42d11b65
Initialize global variables for multiproc in __main__ in clickhouse-test 2021-09-22 16:00:59 +03:00
tavplubix
e0ce179aa8
Minor improvements in clickhouse-test (#29197)
* minor improvements in clickhouse-test

* use enums

* Update clickhouse-test
2021-09-22 11:42:46 +03:00
tavplubix
66bc619c3e
Merge pull request #28983 from ClickHouse/func_zookeeper_session_uptime
Add function zookeeperSessionUptime(), fix some flaky tests
2021-09-20 14:47:49 +03:00
tavplubix
5fdd2b67ee
Update clickhouse-test 2021-09-19 01:05:17 +03:00
Alexander Tokmakov
5c605189ac Merge branch 'master' into func_zookeeper_session_uptime 2021-09-15 21:10:06 +03:00
Alexander Tokmakov
be45ed5fde better check for session expiration in clickhouse-test 2021-09-13 16:36:05 +03:00
Vitaly Baranov
bbb192ee85 Convert skip_list.json into first line comments. 2021-09-12 17:15:23 +03:00
Nikolai Kochetov
0e0c136d43 Fix error code of clickhouse-test if server is dead. 2021-09-09 15:31:29 +03:00
mergify[bot]
02b4e56e6a
Merge branch 'master' into break_some_tests 2021-08-20 13:24:17 +00:00
tavplubix
64bfe21a1b
Fix test 00443_preferred_block_size_bytes.sh (#27846)
* Update 00443_preferred_block_size_bytes.sh

* Update clickhouse-test

* Update clickhouse-test

* Update database_replicated.xml
2021-08-20 00:25:14 +03:00
Alexander Tokmakov
21f2da6d33 Merge branch 'master' into break_some_tests 2021-08-15 22:02:36 +03:00
Alexander Tokmakov
9dd742cc29 more debug info 2021-08-12 13:39:06 +03:00
Alexander Tokmakov
0256e313b3 fix 2021-08-12 00:29:37 +03:00
Raúl Marín
4ebdb5917a clickhouse-test: Implement @@SKIP@@ directive in tests 2021-08-11 15:22:31 +02:00
Alexander Kuzmenkov
2259387f0c make it possible to cancel window functions on ctrl+c 2021-08-09 20:04:42 +03:00
Mike Kot
a308c8f842 Extracted test skipping functions 2021-08-06 17:39:44 +03:00
Mike Kot
af536b1b5e Using formatted string literals, extracted sort funcs in tester 2021-08-06 17:39:44 +03:00
Amos Bird
b541b5eca3
Normalize hostname in CI 2021-08-03 15:00:57 +08:00
Alexander Tokmakov
381634960e fix client options in stress test 2021-07-29 15:16:34 +03:00
tavplubix
858bef8bef
Update clickhouse-test 2021-07-26 19:19:47 +03:00
Alexey Milovidov
d815023700 Fix one source of flaky tests 2021-07-21 03:58:01 +03:00
vdimir
1b5de5de0d
Fix style in clickhouse-test removesuffix 2021-07-20 17:51:22 +03:00
vdimir
8429f64030
Log skipped test if no jinja2 2021-07-20 17:49:20 +03:00
vdimir
6f8561c084
Support jijna templates for sql files in clickhouse-test 2021-07-20 16:40:04 +03:00
Alexander Kuzmenkov
7a48f8ef4c
Merge pull request #25537 from nvartolomei/nv/fix-clickhouse-test-hang-and-status-code
Fix hang and incorrect exit code returned from clickhouse-test
2021-07-08 01:07:17 +03:00