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

nodetool_additional_test.TestGetTraceProbability.test_invalid_value_not_changing_trace_probability assertion failure #18713

Closed
kbr-scylla opened this issue May 16, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@kbr-scylla
Copy link
Contributor

kbr-scylla commented May 16, 2024

This assertion failure is so unreadable

        assert re.search(message, str(error)), f"invalid_value={invalid_value} Expected: message"

first it should be {message} not message
ans second it should also print the str(error) because the failure report apparently truncates it...
But I digress

https://jenkins.scylladb.com/job/scylla-master/job/dtest-debug/295/testReport/junit/nodetool_additional_test/TestGetTraceProbability/Run_Dtest_Parallel_Cloud_Machines___FullDtest___full_split000___test_invalid_value_not_changing_trace_probability/

self = <nodetool_additional_test.TestGetTraceProbability object at 0x7fa3df28b550>
subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7fa4ed175950>, suspend_capture_ctx=<bound method ...pture_fixture=None>>, request=<SubRequest 'subtests' for <Function test_invalid_value_not_changing_trace_probability>>)

    def test_invalid_value_not_changing_trace_probability(self, subtests):
        valid_value = 0.001
        for invalid_value in self.invalid_values_map:
            with subtests.test(invalid_value=invalid_value):
                set_node_probability(self.node1, valid_value)
>               self.set_invalid_trace_probability(node=self.node1, invalid_value=invalid_value, message=self.invalid_values_map[invalid_value])

nodetool_additional_test.py:2705: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <nodetool_additional_test.TestGetTraceProbability object at 0x7fa3df28b550>
node = <ccmlib.scylla_node.ScyllaNode object at 0x7fa3cf7a8350>
invalid_value = 'a'
message = "(can not convert|error: the argument \\('a'\\) for option '--trace_probability' is invalid)"

    def set_invalid_trace_probability(self, node, invalid_value, message: str):
        with pytest.raises(NodetoolError) as error:
            node.nodetool(f"settraceprobability -- {invalid_value}")
>       assert re.search(message, str(error)), f"invalid_value={invalid_value} Expected: message"
E       AssertionError: invalid_value=a Expected: message
E       assert None
E        +  where None = <function search at 0x7fa4ee96d9e0>("(can not convert|error: the argument \\('a'\\) for option '--trace_probability' is invalid)", '<ExceptionInfo ToolError("Subprocess /jenkins/workspace/scylla-master/dtest-debug/scylla/.dtest/dtest-2jdn08vx/test/node1/bin/scylla ...--trace_probability\' is invalid\\n\\nTry --help.\\n; \\nstderr: WARNING: debug mode. Not for benchmarking or production\\n") tblen=3>')
E        +    where <function search at 0x7fa4ee96d9e0> = re.search
E        +    and   '<ExceptionInfo ToolError("Subprocess /jenkins/workspace/scylla-master/dtest-debug/scylla/.dtest/dtest-2jdn08vx/test/node1/bin/scylla ...--trace_probability\' is invalid\\n\\nTry --help.\\n; \\nstderr: WARNING: debug mode. Not for benchmarking or production\\n") tblen=3>' = str(<ExceptionInfo ToolError("Subprocess /jenkins/workspace/scylla-master/dtest-debug/scylla/.dtest/dtest-2jdn08vx/test/node1/bin/scylla ...--trace_probability' is invalid\n\nTry --help.\n; \nstderr: WARNING: debug mode. Not for benchmarking or production\n") tblen=3>)

nodetool_additional_test.py:2662: AssertionError

could be related to native nodetool somehow?

But it seems it appeared only in dtest-debug job for some reason.

Assigning to @denesb because it's nodetool and giving P4 label because it looks extremely unimportant (unless we really want to have green dtest-debug job)

@denesb
Copy link
Contributor

denesb commented May 17, 2024

The test fails because of the message printed by seastar when launching in debug mode:

WARNING: debug mode. Not for benchmarking or production

We changed ccm to filter this out of nodetool output, but maybe it doesn't work when nodetool exits with non-0 exit code, like in this test.

@denesb denesb added this to the 6.1 milestone May 23, 2024
@denesb
Copy link
Contributor

denesb commented May 31, 2024

The problem is actually something else: str(error) ellipsizes the error message if it is too long, and for some reason now it also ellipsizes (cuts out) the part of the error message which we are matching for.

@tchaikov tchaikov closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants