Skip to content

test: wait until admin connection is ready #306

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

Merged

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Aug 7, 2023

This PR fixes flaky server startup and adds asserts to simplify possible debug in the future. See commits for more info.

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-flaky-missing-user branch from fa0eb3c to b9b0905 Compare August 7, 2023 14:42
Current `wait_until_started` method wait till `box.info.status` is
"running" and start sending requests. Such approach is wrong: status
"running" [1] does not guarantees that instance is available for writing
(like creating new users) [2]. It results in flaky test results (for
example, see 4 restarts in [3]).

This patch fixes the issue. After this patch, it is guaranteed that
after `wait_until_ready` call instance had finished to run its
initialization script, including box.cfg, and available for writing data
if it is expected to be able to.

Windows instances use a separate lock mechanism, so this patch is not
related to Windows instances.

1. https://github.com/tarantool/tarantool/blob/983a7ec215d46b6d02935d1baa8bbe07fc371795/src/box/box.cc#L5425-L5426
2. https://github.com/tarantool/tarantool/blob/983a7ec215d46b6d02935d1baa8bbe07fc371795/src/box/box.cc#L5454
3. https://github.com/tarantool/tarantool/actions/runs/5759802620
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-flaky-missing-user branch 2 times, most recently from 98d0208 to 98bf93c Compare August 7, 2023 15:36
Some installation certificates are outdated for Ubuntu 22.04.
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-flaky-missing-user branch 2 times, most recently from 035ca72 to 5cc07fd Compare August 7, 2023 16:28
@DifferentialOrange DifferentialOrange marked this pull request as ready for review August 7, 2023 16:29
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-flaky-missing-user branch 4 times, most recently from 525a1a8 to 84afb05 Compare August 8, 2023 08:14
Admin command are sent through text protocol. Responses are rarely
processed, especially those which sets up schema and users. But such
requests can contain errors, like "already exists" or syntax ones.
Having asserts on schema set up makes it easier to debug some cases.
For example, it was helpful in discovering the reason behind
"user not exists" fails fixed in "wait until server is ready" patchset
commit [1].

1. https://github.com/tarantool/tarantool-python/actions/runs/5784619729/job/15675655683?pr=306
`null` is a common variable in Lua. Since the variable is not declared
and strict mode is off, it is essentially `nil`.
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-flaky-missing-user branch from 84afb05 to a6db2d4 Compare August 8, 2023 08:23
@DifferentialOrange DifferentialOrange merged commit 66e53bc into master Aug 8, 2023
@DifferentialOrange DifferentialOrange deleted the DifferentialOrange/fix-flaky-missing-user branch August 8, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants