python error:
/src/ch/clickhouse/.cmake/../tests/clickhouse-test:2570: SyntaxWarning: invalid escape sequence '\/'
And also remove unnecessary escaping of `/`.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Before it throws internal python error:
$ ../tests/clickhouse-test 03033
Using queries from '/src/ch/clickhouse/tests/queries' directory
Connecting to ClickHouse server... OK
Connected to server 24.3.1.1 @ 3fa6d23730 master
Running 1 stateless tests (MainProcess).
03033_dist: [ UNKNOWN ] - Test internal error:
TypeError
expected str, bytes or os.PathLike object, not NoneType
File "/src/ch/clickhouse/.cmake/../tests/clickhouse-test", line 1644, in run
if not is_valid_utf_8(self.case_file) or not is_valid_utf_8(
^^^^^^^^^^^^^^^
File "/src/ch/clickhouse/.cmake/../tests/clickhouse-test", line 237, in is_valid_utf_8
with open(fname, "rb") as f:
^^^^^^^^^^^^^^^^^
0 tests passed. 0 tests skipped. 0.01 s elapsed (MainProcess).
Won't run stateful tests because test data wasn't loaded.
All tests have finished.
Now:
$ ../tests/clickhouse-test 03033
Using queries from '/src/ch/clickhouse/tests/queries' directory
Connecting to ClickHouse server... OK
Connected to server 24.3.1.1 @ 3fa6d23730 master
Running 1 stateless tests (MainProcess).
03033_dist: [ UNKNOWN ] - no reference file
0 tests passed. 0 tests skipped. 0.11 s elapsed (MainProcess).
Won't run stateful tests because test data wasn't loaded.
All tests have finished.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
* Userspace page cache
* Maybe it'll build this time, who knows.
* 'auto' went out of fashion, I guess
* Documentation, tsan workaround, metric 'UnreclaimableRss', disable page cache in the test that uses DatabaseOrdinary
* Moved CachedInMemoryReadBufferFromFile to object store level, changed settings, addressed other comments.
* Fix
* Another fix
* Fix restricted seek, fix ppc64le build
* Don't allow page cache with file cache
* Adjust tests a little
* Fix clang-tidy
* Conflicts
* Comments
* Maybe unbroke AsynchronousBoundedReadBuffer
* SettingsChangesHistory.h
* Fix warning in test
* Userspace page cache
* Maybe it'll build this time, who knows.
* 'auto' went out of fashion, I guess
* Documentation, tsan workaround, metric 'UnreclaimableRss', disable page cache in the test that uses DatabaseOrdinary
* Moved CachedInMemoryReadBufferFromFile to object store level, changed settings, addressed other comments.
* Fix
* Another fix
* Fix restricted seek, fix ppc64le build
* Don't allow page cache with file cache
* Adjust tests a little
* Fix clang-tidy
* Conflicts
* Comments
* Maybe unbroke AsynchronousBoundedReadBuffer
* SettingsChangesHistory.h
* Fix warning in test
The problem with --foreground option is that it send the signal only to
the process that had been spawned by timeout(1), while it can create
lots of children, and when you killing parent you are closing pipes and
childrens will get EPIPE, like in [1].
[1]: https://s3.amazonaws.com/clickhouse-test-reports/0/069f8bbb2f48541cc736903e1da5459fa2c27da0/stateless_tests__debug__%5B2_5%5D.html
Another problem is that now child process will finish correctly, which
may also print some errors like QUERY_WAS_CANCELLED (see [2]).
[2]: https://s3.amazonaws.com/clickhouse-test-reports/0/ef66714bf20042ba9cb5d59b7839befe26110b93/stateless_tests__release__analyzer_.html
In general this is not required actually, since all timeout invocations
uses timeout value less then the default test limit (10min). But it may
leave some processes in case of overriding this limit, i.e.
`clickhouse-test --timeout 1`
So to workaround this at least somehow, let's send SIGTERM and only
after some timeout (here I use 0.1), SIGKILL. This will give at least
some ability to terminate all childrens that had been spawned by
timeout(1).
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
One of such cases is 02479_race_condition_between_insert_and_droppin_mv
[1], yes it can be fixed (by using fixed number of iterations, or with
some bash trickery), but it is better to fix them completelly,
eventually such tests will be submitted and pass review anyway.
By allocating process group for each test we can kill all the processes
in this process group, and this what this patch does.
This will also fix some test hangs (like in [1]) as well as some
possible issues in stress tests.
[1]: https://s3.amazonaws.com/clickhouse-test-reports/0/e2c1230b00386c4d0096a245396ab3be7ce60950/stateless_tests__release__analyzer_/run.log
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 72fa58e192)
One of such cases is 02479_race_condition_between_insert_and_droppin_mv
[1], yes it can be fixed (by using fixed number of iterations, or with
some bash trickery), but it is better to fix them completelly,
eventually such tests will be submitted and pass review anyway.
By allocating process group for each test we can kill all the processes
in this process group, and this what this patch does.
This will also fix some test hangs (like in [1]) as well as some
possible issues in stress tests.
[1]: https://s3.amazonaws.com/clickhouse-test-reports/0/e2c1230b00386c4d0096a245396ab3be7ce60950/stateless_tests__release__analyzer_/run.log
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Previusly it worked only for the case when the clickhouse-client/script
exited with non 0, because the check was done before checking the
reference file.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
The problem is that old versions of cURL (7.81.0 at least) handle
additional parameters incorrectly if in previous parameter was "/":
$ docker run --rm curlimages/curl:8.1.2 --http1.1 --get -vvv 'http://kernel.org/?bar=foo/baz' --data-urlencode "query=select 1 format Null"; echo
> GET /?bar=foo/baz&query=select+1+format+Null HTTP/1.1
> User-Agent: curl/8.1.2
$ docker run --rm curlimages/curl:7.81.0 --http1.1 --get -vvv 'http://kernel.org/?bar=foo/baz' --data-urlencode "query=select 1 format Null"; echo
> GET /?bar=foo/baz?query=select+1+format+Null HTTP/1.1
> User-Agent: curl/7.81.0-DEV
Note, that I thought about making the same for cli, but it is not that
easy, even after getting rid of sh -c and string contantenation, it
still cannot be done for CLICKHOUSE_CLIENT_OPT.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
There was some cases when some patches to the datetime code leads to
flaky tests, due to the tests itself had been runned using regular
timezone (TZ).
But if you will this tests with something "specific" (that is not
strictly defined around 1970 year), those tests will fail.
So to catch such issues in the PRs itself, let's randomize
session_timezone as well.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>