Hi Zsolt,
The snapshot change looks correct to me.
Two small points about the test:
The return value of poll_query_until() should be checked. On timeout it
returns false, so currently the test can continue without confirming
that the old worker has stopped.
ALTER DATABASE ... RESET does not change an existing worker's setting.
A worker starting between TRUNCATE and RESET can retain SERIALIZABLE
for the next test. I'd disable the subscription and wait for the worker
to stop, then truncate, reset the setting, and re-enable it.
Thank you!
Best regards, Andrey Borodin.