[ https://issues.apache.org/jira/browse/CASSANDRA-18947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17791728#comment-17791728 ]
Ekaterina Dimitrova commented on CASSANDRA-18947: ------------------------------------------------- bq. Oh so you'd rather use async_almost_equal directly? Or you can use it as it is now for consistency with the rest of the test class, if sbdy improves/fixes assert_balanced in the future, which is the most probable, this test method would not benefit from that,.. To me it's not confusing. ICWYM but the little extra loop vs benefits... There are arguments both sides imo. I don't have a strong preference here. Well, to me, it was a matter of clean code, and if we were thinking of fixing it, then better to fix it or go to the increased loop path until it is fixed. But if it is only me finding this confusing - +1. The repeated runs also LGTM. Thanks for looking into the problem. (ignoring the problem that was already mentioned to be solved in another ticket) > Test failure: > dtest-novnode.disk_balance_test.TestDiskBalance.test_disk_balance_stress > -------------------------------------------------------------------------------------- > > Key: CASSANDRA-18947 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18947 > Project: Cassandra > Issue Type: Bug > Components: Test/dtest/python > Reporter: Ekaterina Dimitrova > Assignee: Berenguer Blasi > Priority: Normal > Fix For: 5.0-rc > > > Seen here: > https://ci-cassandra.apache.org/job/Cassandra-5.0/72/testReport/dtest-novnode.disk_balance_test/TestDiskBalance/test_disk_balance_stress/ > h3. > {code:java} > Error Message > AssertionError: values not within 10.00% of the max: (2534183, 2762123, > 2423706) (node1) > Stacktrace > self = <disk_balance_test.TestDiskBalance object at 0x7f8fae9b7590> def > test_disk_balance_stress(self): cluster = self.cluster if > self.dtest_config.use_vnodes: > cluster.set_configuration_options(values={'num_tokens': 256}) > cluster.populate(4).start() node1 = cluster.nodes['node1'] > node1.stress(['write', 'n=50k', 'no-warmup', '-rate', 'threads=100', > '-schema', 'replication(factor=3)', > 'compaction(strategy=SizeTieredCompactionStrategy,enabled=false)']) > cluster.flush() # make sure the data directories are balanced: for node in > cluster.nodelist(): > self.assert_balanced(node) disk_balance_test.py:48: _ _ > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > disk_balance_test.py:186: in assert_balanced assert_almost_equal(*new_sums, > error=0.1, error_message=node.name) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (2534183, 2762123, 2423706) > kwargs = {'error': 0.1, 'error_message': 'node1'}, error = 0.1, vmax = > 2762123 vmin = 2423706, error_message = 'node1' def > assert_almost_equal(*args, **kwargs): """ Assert variable number of arguments > all fall within a margin of error. @params *args variable number of numerical > arguments to check @params error Optional margin of error. Default 0.16 > @params error_message Optional error message to print. Default '' Examples: > assert_almost_equal(sizes[2], init_size) assert_almost_equal(ttl_session1, > ttl_session2[0][0], error=0.005) """ error = kwargs['error'] if 'error' in > kwargs else 0.16 vmax = max(args) vmin = min(args) error_message = '' if > 'error_message' not in kwargs else kwargs['error_message'] assert vmin > vmax > * (1.0 - error) or vmin == vmax, \ > "values not within {:.2f}% of the max: > {} ({})".format(error * 100, args, error_message) E AssertionError: values > not within 10.00% of the max: (2534183, 2762123, 2423706) (node1) > tools/assertions.py:206: AssertionError > {code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org