Skip to content
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

[master] test: fix flakiness in gh_6128_background_mode_test (again) #8836

Merged

Conversation

ligurio
Copy link
Member

@ligurio ligurio commented Jul 3, 2023

NOTE: PR 2.10 - #8834

Previous attempt to fix flakiness in commit 6a2c73f ("test: fix flakiness in gh_6128_background_mode_test") used a constant buffer size in check_err_msg function. Tarantool 2.10 has a bit bigger log before a desired message that other versions of Tarantool and it leads to a this resulted in a truncated message ("entering the even" instead of "entering the event loop"). Patch replaces check_err_msg() implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the event loop" is not an error message.

Follows up #6128

NO_CHANGELOG=fix test
NO_DOC=fix test

@ligurio ligurio changed the title test: fix flakiness in gh_6128_background_mode_test [master] test: fix flakiness in gh_6128_background_mode_test Jul 3, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
@ligurio ligurio force-pushed the ligurio/gh-6128-fix-flaky-test-2-master branch from 8e37a58 to 4601403 Compare July 3, 2023 15:17
@ligurio ligurio requested review from Lord-KA and ylobankov July 3, 2023 15:20
@ligurio ligurio changed the title [master] test: fix flakiness in gh_6128_background_mode_test [master] test: fix flakiness in gh_6128_background_mode_test (again) Jul 3, 2023
@coveralls
Copy link

Coverage Status

coverage: 86.002% (-0.01%) from 86.014% when pulling 4601403 on ligurio:ligurio/gh-6128-fix-flaky-test-2-master into e1ed31b
on tarantool:master
.

@ligurio ligurio added the full-ci Enables all tests for a pull request label Jul 3, 2023
Copy link
Contributor

@Lord-KA Lord-KA left a comment

Choose a reason for hiding this comment

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

Thanks for the patch! We've discussed in dm, that luatest.Server can't be used instead of popen, as it automatically initializes box.cfg{}, while for the test purposes it should be done from the shell (with -e). Besides that, as the dummy server in check_msg is not started, we don't need to kill it, thus it is ok too. Overall, LGTM.

Nit: maybe comment on the issues above in the code.

@Lord-KA Lord-KA assigned ligurio and igormunkin and unassigned ligurio Jul 4, 2023
@igormunkin igormunkin merged commit 1c8e712 into tarantool:master Jul 4, 2023
144 checks passed
@igormunkin
Copy link
Collaborator

Also backported to 2.11 and 2.10 in scope of 9d5cd29 and 2a36fa7 respectively.

@ligurio ligurio deleted the ligurio/gh-6128-fix-flaky-test-2-master branch July 4, 2023 10:44
ligurio added a commit to tarantool/luatest that referenced this pull request Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836
ligurio added a commit to tarantool/luatest that referenced this pull request Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this pull request Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this pull request Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this pull request Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this pull request Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this pull request Aug 14, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this pull request Aug 14, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Enables all tests for a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants