I don't see the reason for using expect here, and plus now the test is
only 2 lines instead.
Also this conversion should fix the test flakiness, since sometimes 60
seconds is not enough [1]:
2023.06.26 17:42:29.582168 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Debug> executeQuery: Query span trace_id for opentelemetry log: 00000000-0000-0000-0000-000000000000
2023.06.26 17:42:29.584019 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Debug> executeQuery: (from [::1]:38130) (comment: 02003_memory_limit_in_client.expect) SELECT arrayMap(x -> range(x), range(number)) FROM numbers(1000) (stage: Complete)
2023.06.26 17:42:29.588131 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Trace> InterpreterSelectQuery: FetchColumns -> Complete
2023.06.26 17:42:29.780980 [ 2566 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Debug> MemoryTracker: Current memory usage (for query): 1.24 GiB.
2023.06.26 17:43:29.179098 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Information> TCPHandler: Client has dropped the connection, cancel the query.
2023.06.26 17:44:05.523345 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Information> executeQuery: Code: 394. DB::Exception: Query was cancelled or a client has unexpectedly dropped the connection. (QUERY_WAS_CANCELLED) (version 23.6.1.1) (from [::1]:38130) (comment: 02003_memory_limit_in_client.expect) (in query: SELECT arrayMap(x -> range(x), range(number)) FROM numbers(1000))
2023.06.26 17:44:05.680631 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Debug> MemoryTracker: Peak memory usage (for query): 1.25 GiB.
2023.06.26 17:44:05.680747 [ 13456 ] {8a324061-a504-4843-be65-6abb5db4bc5c} <Debug> TCPHandler: Processed in 96.108615451 sec.
[1]: https://s3.amazonaws.com/clickhouse-test-reports/51407/e92035072b7b3367da12089b28041893eb90e636/stateless_tests__tsan__[2_5].html
And it is either expect is too slow, or server did not respond for
awhile, but this was a TSan build and trace_log is empty, so it is not
possible to check which one was the problem.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>