-
Notifications
You must be signed in to change notification settings - Fork 556
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
tests/ssx/single_sharded: fix -c1 and correct test file name #20152
base: dev
Are you sure you want to change the base?
tests/ssx/single_sharded: fix -c1 and correct test file name #20152
Conversation
0e2334f
to
3c50f99
Compare
/dt |
/dt |
3c50f99
to
4e8b69d
Compare
test failure unrelated |
@@ -80,7 +80,7 @@ struct caller { | |||
|
|||
SEASTAR_THREAD_TEST_CASE(single_sharded) { | |||
ss::shard_id the_shard = ss::smp::count - 1; | |||
ss::shard_id wrong_shard = std::max(ss::shard_id{0}, the_shard - 1); | |||
ss::shard_id wrong_shard = ss::smp::count == 1 ? 0 : the_shard - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if we run with -c1
, there is no wrong shard, right? So I guess it would be more obvious if the part of the test requiring several shards would be clearly encapsulated in a code block (or maybe even a separate test) and wrong_shard
would be declared there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think of an existing test that requires multiple shards? What does it do if there is only one shard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its ok to assume a minimum shard count in tests, just have an assert in the test, something like
BOOST_REQUIRE_GT(ss::smp::count, 1)
There are tests in the tree that does this, better to assert out than a segfault.
Unsigned overflow prevented this test from running with -c1.
Test file name did not have _test suffix.
Backports Required
Release Notes