Skip to content

test_run:wait_log - drop redundant assert #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
merged 1 commit into from
May 28, 2021

Conversation

Totktonada
Copy link
Member

The callee wait_cond does setup timeout by self in case if not provided

local function wait_cond(self, cond, timeout, delay)
    ...
    local timeout = timeout or 60
    ...
end

local function wait_log(self, node, what, bytes, timeout, opts)
    ...
    return wait_cond(self, cond, timeout, delay)
end

so no need to verify if timeout is provided in wait_log args.

@Totktonada: The wait_cond() and wait_log() helpers were added in 1 without a
default timeout: so they assert that a caller provides it. Later, in 2, the
default timeout was added for wait_cond(). Here we forgot to drop the assertion
from wait_log().

Signed-off-by: Cyrill Gorcunov <[email protected]>

The callee wait_cond does setup timeout by self in case if not provided

 | local function wait_cond(self, cond, timeout, delay)
 |     ...
 |     local timeout = timeout or 60
 |     ...
 | end
 |
 | local function wait_log(self, node, what, bytes, timeout, opts)
 |     ...
 |     return wait_cond(self, cond, timeout, delay)
 | end

so no need to verify if timeout is provided in wait_log args.

@Totktonada: The wait_cond() and wait_log() helpers were added in [1] without a
default timeout: so they assert that a caller provides it. Later, in [2], the
default timeout was added for wait_cond(). Here we forgot to drop the assertion
from wait_log().

[1]: 670f330 ('test: wait for logs')
[2]: fe9ca2e ('Add default timeout for wait_cond routine')

Signed-off-by: Cyrill Gorcunov <[email protected]>
@Totktonada
Copy link
Member Author

LGTM.

Copy link
Contributor

@avtikhon avtikhon left a comment

Choose a reason for hiding this comment

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

Patch LGTM.

Copy link
Contributor

@VitaliyaIoffe VitaliyaIoffe left a comment

Choose a reason for hiding this comment

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

LGTM

@Totktonada Totktonada merged commit 54fa0cd into master May 28, 2021
@Totktonada Totktonada deleted the gorcunov/wait-log-drop-redundant-assert branch May 28, 2021 09:34
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307

(cherry picked from commit 0f44ede)
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307

(cherry picked from commit 0f44ede)
Totktonada added a commit to tarantool/tarantool that referenced this pull request May 28, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307

(cherry picked from commit 0f44ede)
@Totktonada
Copy link
Member Author

Updated the test-run submodule in tarantool in the following commits: 2.9.0-45-g0f44ede23, 2.8.1-23-g1b632d36c, 2.7.2-18-g9221e0e28, 1.10.10-10-gbc8463d67.

avtikhon pushed a commit to avtikhon/tarantool that referenced this pull request Jun 1, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307
avtikhon pushed a commit to avtikhon/tarantool that referenced this pull request Jun 1, 2021
There are several updates in test-run:

* Unit testing and coverage collecting for test-run ([1]).
  (Plus a fixup for `--disable-schema-upgrade` for Python 3.5.)
* Allow to miss a timeout in test_run:wait_log(): it is 60 seconds by
  default ([2]).
* pretest_clean: add built-in `UUID()` SQL function ([3]).

[1]: tarantool/test-run#283
[2]: tarantool/test-run#306
[3]: tarantool/test-run#307
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.

4 participants