neorados_pool_test: Call create_pool at the end of NeoRados delete_pool related test#61449
neorados_pool_test: Call create_pool at the end of NeoRados delete_pool related test#61449
Conversation
|
jenkins test make check |
Matan-B
left a comment
There was a problem hiding this comment.
This will work, it seems that CoTearDown unconditionally will try to delete any created pool (even if it was deleted already).
@mohit84, what do you think about updating this test delete_pool to also remove the deleted pool from created_pools instead?
That way we can avoid the double deletion on teardown.
We can but i am not sure the purpose of this. I think @adamemerson can confirm more about it , what is the best way to resolve it. Actually it is not unconditional, it try to delete a pool on the pool exists in created_pool map but the issue is it seems it is not in sync. Ideally we should erase a pool name during delete_pool then CoTearDown should work but i already tried it was not working due to the nature of async of co_await. We have to to use a mutex to synchronize created_pools map. |
There was a problem hiding this comment.
We can but i am not sure the purpose of this. I think @adamemerson can confirm more about it , what is the best way to resolve it. Actually it is not unconditional, it try to delete a pool on the pool exists in created_pool map but the issue is it seems it is not in sync. Ideally we should erase a pool name during delete_pool then CoTearDown should work but i already tried it was not working due to the nature of async of co_await. We have to to use a mutex to synchronize created_pools map.
The purpose would be to not add extra "create pool", which is not related to the test case to not trigger errors on teardown.
The test case of e.g PoolDelete - creates a pool and deletes it.
With the current patch, the test actually:
- creates a pool
- deletes it
- creates a pool again
Regarding the sync issues you mentioned, I'm not sure I understand. When using co_await we will wait until the function future is ready.
Actually it was my understanding gap, after erasing a pool name the test case was getting crashed because CoTearDown was trying to iterate over original copy, after make it local_copy i am able to resolve the crash. |
|
jenkins test make check |
Matan-B
left a comment
There was a problem hiding this comment.
Actually it was my understanding gap, after erasing a pool name the test case was getting crashed because CoTearDown was trying to iterate over original copy, after make it local_copy i am able to resolve the crash.
This looks much better, I'm not sure why the local copy is needed though. Can you please explain?
nit: PR title is outdated.
| /// \brief Delete pool used for testing | ||
| boost::asio::awaitable<void> CoTearDown() override { | ||
| for (const auto& name : created_pools) try { | ||
| auto pools_to_delete = created_pools; |
There was a problem hiding this comment.
Why can't we iterate over created_pools?
There was a problem hiding this comment.
It is required because created_pools is only modified by delete_pool not by delete_pool is calling via CoTearDown. I observed without this change a test case was getting crashed
It is required because created_pools is only modified by delete_pool not by delete_pool is calling via CoTearDown. I observed without this change a test case was getting crashed |
The test case itself call CoTearDown function by the end of every test case
and the function call delete_pool on the basis of pool name exists in
local set <created_pools> and if the pool does not exist during CoTearDown
it throws an exception so the test case expects the pool should be exists
before leaving the test case.
Solution: During delete_pool erase a pool name from a local map
and CoTearDown iterate over local copy instead of the
orignal copy.
Fixes: https://tracker.ceph.com/issues/69405
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
done |
|
jenkins test make check |
Matan-B
left a comment
There was a problem hiding this comment.
I'm not sure about the local copy iteration but I prefer getting this one merged since it causes failures in every rados_api job tests. We can improve this in a follow up PR (cc @adamemerson)
|
@mohit84, can you please run this one through the suite? |
|
jenkins test make check arm64 |
adamemerson
left a comment
There was a problem hiding this comment.
You could also catch and swallow the exception, I think. Though considering how few tests there were the 'cleanup' phase is probably overkill and we could just get rid of it. I was expecting to be creating and listing large numbers of pools when I wrote it.
The test case is passed |
Classic run: https://pulpito.ceph.com/matan-2025-01-28_09:11:13-rados-issue_69405-distro-default-smithi/ |
The test case itself call CoTearDown function by the end of every test case and the function call delete_pool on the basis of pool name exists in local set <created_pools> and if the pool does not exist during CoTearDown it throws an exception so the test case expects the pool should be exists before leaving the test case.
Solution: Call create_pool to avoid an error during CoTearDown
Fixes: https://tracker.ceph.com/issues/69405
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e