Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix running integration tests with spaces in it's names #51514

Merged
merged 8 commits into from
Jul 22, 2023

Conversation

azat
Copy link
Collaborator

@azat azat commented Jun 28, 2023

Previously they were simply ignored, and not only them, but all the
tests in that group, here is an example 1

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jun 28, 2023
@robot-ch-test-poll3
Copy link
Contributor

robot-ch-test-poll3 commented Jun 28, 2023

This is an automated comment for commit baf6d18 with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🔴 failure

Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help🟢 success
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR🟢 success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process🟢 success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help🟢 success
Docker image for serversThe check to build and optionally push the mentioned image to docker hub🟢 success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here🟢 success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc🟢 success
Install packagesChecks that the built packages are installable in a clear environment🟢 success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests🟢 success
Mergeable CheckChecks if all other necessary checks are successful🟢 success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests🟢 success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub🟢 success
SQLancerFuzzing tests that detect logical bugs with SQLancer tool🟢 success
SqllogicRun clickhouse on the sqllogic test set against sqlite and checks that all statements are passed🟢 success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc🟢 success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc🟢 success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors🟢 success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report🟢 success
Unit testsRuns the unit tests for different release types🟢 success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts🔴 failure

tests/integration/runner Outdated Show resolved Hide resolved
@qoega qoega self-assigned this Jun 28, 2023
@azat azat force-pushed the tests/fix-integration-tests branch from d4135cd to 7835ed3 Compare June 29, 2023 12:08
@azat azat marked this pull request as draft June 29, 2023 12:14
@azat azat force-pushed the tests/fix-integration-tests branch from 7835ed3 to a1f5dbb Compare June 29, 2023 12:17
@azat azat marked this pull request as ready for review June 29, 2023 12:17
@azat azat force-pushed the tests/fix-integration-tests branch from a1f5dbb to 227eb94 Compare June 30, 2023 08:45
@azat
Copy link
Collaborator Author

azat commented Jul 7, 2023

@alexey-milovidov
Copy link
Member

What has happened with the test for test_postgresql_replica_database_engine_1?

@azat
Copy link
Collaborator Author

azat commented Jul 8, 2023

All tests had been failed because of the runner got killed (see above):

[gw1] [ 81%] PASSED test_merge_tree_s3/test.py::test_table_manipulations[node] Killed

@alexey-milovidov
Copy link
Member

This PR was expected to find a failed test for UDF, but it didn't: #51964

@alexey-milovidov
Copy link
Member

Interesting, why the runner was killed?

@alexey-milovidov
Copy link
Member

What's wrong with

Upgrade check (tsan) — Possible deadlock on shutdown (see gdb.log)

?

@alexey-milovidov
Copy link
Member

@azat I cannot find executable_user_defined_function/ in the list of passed tests.

@alexey-milovidov
Copy link
Member

Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

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

.

@azat azat force-pushed the tests/fix-integration-tests branch 2 times, most recently from 0b26dbf to ce061ba Compare July 9, 2023 06:50
@azat
Copy link
Collaborator Author

azat commented Jul 9, 2023

@azat I cannot find executable_user_defined_function/ in the list of passed tests.

Nice catch, there was an error due to single quotes in quotes:

https://s3.amazonaws.com/clickhouse-test-reports/51514/7e8ccade3517f55e111c6dbfac653dcd7ed18019/integration_tests__release__[4_4]/integration_run_parallel1_0.log

docker: invalid reference format.

@azat This group https://s3.amazonaws.com/clickhouse-test-reports/51514/7e8ccade3517f55e111c6dbfac653dcd7ed18019/integration_tests__release__[1_4].html
has parallel runs №1, 2, 3, and 5, but not 4.

Same:

https://s3.amazonaws.com/clickhouse-test-reports/51514/7e8ccade3517f55e111c6dbfac653dcd7ed18019/integration_tests__release__[1_4]/integration_run_parallel4_0.log

/bin/sh: 1: Syntax error: "(" unexpected

Both had be addressed

@alexey-milovidov
Copy link
Member

Now it solves the problem!
But we have to fix the newly found forgotten tests...

@azat azat force-pushed the tests/fix-integration-tests branch from ce061ba to b03d813 Compare July 12, 2023 13:23
@azat
Copy link
Collaborator Author

azat commented Jul 13, 2023

test_extreme_deduplication/test.py::test_deduplication_window_in_seconds

@azat azat force-pushed the tests/fix-integration-tests branch from b03d813 to 4e7a7b5 Compare July 13, 2023 12:24
@azat
Copy link
Collaborator Author

azat commented Jul 13, 2023

Integration tests (asan) [4/6] — fail: 4, passed: 371, flaky: 0

Still cannot parse tests with spaces, 4e7a7b5 (#51514) should resolve the problem.

Conflicting files
tests/integration/runner

Rebased (sigh).

@azat
Copy link
Collaborator Author

azat commented Jul 15, 2023

Integration tests (asan) [4/6] — fail: 1, passed: 374, flaky: 0
Integration tests (release) [4/4] — fail: 1, passed: 525, flaky: 0
Integration tests (tsan) [4/6] — fail: 1, passed: 374, flaky: 0

Integration tests (asan, analyzer) [1/6] — fail: 34, passed: 261, flaky: 0

  • Differences in exception names - I.e. Unknown function MySum vs Function with name 'MySum' does not exists
  • Somewhere the server crashes (since optimize_skip_unused_shards leads to SIGSEGV now, I was going to look at this after Fix optimize_skip_unused_shards with JOINs #51037)
  • TCPHandler: Code: 10. DB::Exception: Not found column tcpPort() in block.
  • 2023.07.13 13:39:08.509341 [ 8 ] {} <Error> Application: DB::Exception: Setting allow_experimental_analyzer is neither a builtin setting nor started with the prefix 'custom_' registered for user-defined settings

But why they had not marked as "not failed"? #50926 - The problem is new parsing that appends the - Exception

Integration tests (release) [2/4] — fail: 8, passed: 565, flaky: 0

  • test_lost_part
E           AssertionError: Still have something in replication queue:
E             Row 1:
E             ──────
E             database:               default
E             table:                  mt3
E             replica_name:           node2
E             position:               0
E             node_name:              queue-0000000000
E             type:                   GET_PART
E             create_time:            2023-07-13 14:07:07
E             required_quorum:        0
E             source_replica:         node1
E             new_part_name:          8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0
E             parts_to_merge:         []
E             is_detach:              0
E             is_currently_executing: 0
E             num_tries:              13108
E             last_exception:         
E             last_exception_time:    1970-01-01 00:00:00
E             last_attempt_time:      2023-07-13 14:13:07
E             num_postponed:          13593
E             postpone_reason:        Not executing log entry queue-0000000000 for part 8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0 because it is not disjoint with part 8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0_1 that is currently executing.
E             last_postpone_time:     2023-07-13 14:13:07
E             merge_type:             
E             
E             Row 2:
E             ──────
E             database:               default
E             table:                  mt3
E             replica_name:           node2
E             position:               1
E             node_name:              queue-0000000001
E             type:                   MUTATE_PART
E             create_time:            2023-07-13 14:07:07
E             required_quorum:        0
E             source_replica:         node1
E             new_part_name:          8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0_1
E             parts_to_merge:         ['8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0']
E             is_detach:              0
E             is_currently_executing: 1
E             num_tries:              13108
E             last_exception:         
E             last_exception_time:    1970-01-01 00:00:00
E             last_attempt_time:      2023-07-13 14:13:07
E             num_postponed:          13107
E             postpone_reason:        Not executing log entry queue-0000000001 for part 8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0_1 because it is not disjoint with part 8b8f0fede53df97513a9fb4cb19dc1e4_0_0_0 that is currently executing.
E             last_postpone_time:     2023-07-13 14:13:07
E             merge_type:             
E             
E           assert False

Integration tests (tsan) [5/6] — fail: 1, passed: 521, flaky: 2

@azat azat marked this pull request as draft July 15, 2023 06:52
@azat azat force-pushed the tests/fix-integration-tests branch from 4e7a7b5 to 936d7c0 Compare July 15, 2023 07:16
@azat azat marked this pull request as ready for review July 15, 2023 07:16
@azat azat force-pushed the tests/fix-integration-tests branch from 936d7c0 to aa90e11 Compare July 15, 2023 13:03
@azat azat marked this pull request as draft July 15, 2023 20:29
azat added 6 commits July 17, 2023 17:17
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Previously they were simply ignored, and not only them, but all the
tests in that group, here is an example [1]

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/51448/4ed462ac7834a8180f92ca7d7d3c076e687bfca9/integration_tests__asan__[4_6].html

Note, that I've replaced PYTEST_OPTS with handled by pytest itself
PYTEST_ADDOPTS, since "sh -c $PYTEST_OPTS" does not allows you to
preserve the arguments correctly.

v5: use double quotes for PYTEST_ADDOPTS value
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
It had been fixed and now it is allowed.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat azat force-pushed the tests/fix-integration-tests branch from aa90e11 to ee5e639 Compare July 17, 2023 15:33
@azat azat marked this pull request as ready for review July 17, 2023 15:33
azat added 2 commits July 18, 2023 12:22
…ilures

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat azat force-pushed the tests/fix-integration-tests branch from b04e72c to baf6d18 Compare July 18, 2023 10:22
@alexey-milovidov alexey-milovidov merged commit e5797b7 into ClickHouse:master Jul 22, 2023
269 of 270 checks passed
@azat azat deleted the tests/fix-integration-tests branch July 22, 2023 05:14
pytest_opts = " ".join(args.pytest_args).replace("'", "\\'")
tests_list = " ".join(args.tests_list)
# NOTE: since pytest options is in the argument value already we need to additionally escape '"'
pytest_opts = " ".join(
Copy link
Member

Choose a reason for hiding this comment

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

@azat this broke sending extra arguments to pytest like -k because everything is put under the same quote and parsed as test name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It should work, maybe you are using old env variable name? The new one is PYTEST_ADDOPTS

Copy link
Member

Choose a reason for hiding this comment

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

did you try running an integration test using runner and filtering, e.g. test_keeper_back_to_back -k test_concurrent_watches?

AFAIS, the entire pytest_args are quoted.

Copy link
Collaborator Author

@azat azat Aug 7, 2023

Choose a reason for hiding this comment

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

$ DOCKER_HOST=unix:///run/docker-privileged.sock tests/integration/runner --disable-net-host --binary $(which clickhouse) -- test_keeper_back_to_back -k test_concurrent_watches
2023-08-07 18:50:57,015 [ 25841 ] INFO : ClickHouse root is not set. Will use /src/ch/worktrees/clickhouse-upstream (runner:42, check_args_and_update_paths)
2023-08-07 18:50:57,015 [ 25841 ] INFO : Base configs dir is not set. Will use /src/ch/worktrees/clickhouse-upstream/programs/server (runner:77, check_args_and_update_paths)
2023-08-07 18:50:57,015 [ 25841 ] INFO : Cases dir is not set. Will use /src/ch/worktrees/clickhouse-upstream/tests/integration (runner:90, check_args_and_update_paths)
2023-08-07 18:50:57,015 [ 25841 ] INFO : src dir is not set. Will use /src/ch/worktrees/clickhouse-upstream/src (runner:97, check_args_and_update_paths)
2023-08-07 18:50:57,015 [ 25841 ] INFO : base_configs_dir: /src/ch/worktrees/clickhouse-upstream/programs/server, binary: /src/ch/clickhouse/.cmake-llvm16/programs/clickhouse, cases_dir: /src/ch/worktrees/clickhouse-upstream/tests/integration  (runner:99, check_args_and_update_paths)
clickhouse_integration_tests_volume
Running pytest container as: 'docker run  -it --rm --name clickhouse_integration_tests_9xl5v8 --privileged --dns-search='.' --volume=/src/ch/clickhouse/.cmake-llvm16/programs/clickhouse-odbc-bridge:/clickhouse-odbc-bridge --volume=/src/ch/clickhouse/.cmake-llvm16/programs/clickhouse:/clickhouse --volume=/src/ch/clickhouse/.cmake-llvm16/programs/clickhouse-library-bridge:/clickhouse-library-bridge --volume=/src/ch/worktrees/clickhouse-upstream/programs/server:/clickhouse-config --volume=/src/ch/worktrees/clickhouse-upstream/tests/integration:/ClickHouse/tests/integration --volume=/src/ch/worktrees/clickhouse-upstream/src/Server/grpc_protos:/ClickHouse/src/Server/grpc_protos --volume=/run:/run/host:ro --volume=clickhouse_integration_tests_volume:/var/lib/docker   -e DOCKER_CLIENT_TIMEOUT=300 -e COMPOSE_HTTP_TIMEOUT=600  -e PYTHONUNBUFFERED=1 -e PYTEST_ADDOPTS=" test_keeper_back_to_back -k test_concurrent_watches   -vvv" clickhouse/integration-tests-runner:latest '.
Start tests
========================================================================================================================================= test session starts =========================================================================================================================================
platform linux -- Python 3.10.6, pytest-7.4.0, pluggy-1.2.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /ClickHouse/tests/integration
configfile: pytest.ini
plugins: xdist-3.3.1, repeat-0.9.1, random-0.2, order-1.0.0, timeout-2.1.0
timeout: 900.0s
timeout method: signal
timeout func_only: False
collected 9 items / 8 deselected / 1 selected

test_keeper_back_to_back/test.py::test_concurrent_watches PASSED                                                                                                                                                                                                                                [100%]

============================================================================================================================= 1 passed, 8 deselected in 67.29s (0:01:07) ==============================================================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-not-for-changelog This PR should not be mentioned in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants