This PR formats all the `*.py` files found under the `tests/integration`
folder. It also reorders the imports and cleans up a bunch of unused
imports.
The formatting also takes care of other things like wrapping lines and
fixing spaces and indents such that the tests look more readable.
After this patch SYSTEM FLUSH LOGS will force system.*_log table
creatoins (only for enabled tables of course).
This will avoid such hacks like:
set log_queries=1;
select 1;
system flush logs;
This is the second version of the patch, since first has a deadlock [1]
(reported by @alesapin). This version does not use separate lock and do
not issue CREATE TABLE from the query execution thread, instead it
activate flushing thread to do so, hence this should be the same as if
the table will be created during flush.
[1]: https://gist.github.com/alesapin/d915d1deaa27d49aa31223daded02be2Fixes: #11563
Cc: @alesapin
Cc: @nikitamikhaylov