diff options
author | Leonid Usov <leonid.usov@ibm.com> | 2023-07-27 17:55:19 +0200 |
---|---|---|
committer | Leonid Usov <leonid.usov@ibm.com> | 2023-08-01 10:44:19 +0200 |
commit | 0355021e8fb3cd013a477339baf55825b615aac7 (patch) | |
tree | 2d3e82cd816a05357ec907f060ea13d2d37d7391 /src/test/osd | |
parent | Merge pull request #52701 from rhcs-dashboard/flake8-fix (diff) | |
download | ceph-0355021e8fb3cd013a477339baf55825b615aac7.tar.xz ceph-0355021e8fb3cd013a477339baf55825b615aac7.zip |
test/TestOSDMap: don't use the deprecated std::random_shuffle method
Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
Fixes: https://tracker.ceph.com/issues/62203
Diffstat (limited to 'src/test/osd')
-rw-r--r-- | src/test/osd/TestOSDMap.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/osd/TestOSDMap.cc b/src/test/osd/TestOSDMap.cc index 9374ebd40da..c3c8a153158 100644 --- a/src/test/osd/TestOSDMap.cc +++ b/src/test/osd/TestOSDMap.cc @@ -2349,7 +2349,9 @@ TEST_F(OSDMapTest, ReadBalanceScore1) { float fratio = 1. / (float)replica_count; for (int iter = 0 ; iter < 100 ; iter++) { // run the test 100 times // Create random shuffle of OSDs - std::random_shuffle (osds.begin(), osds.end()); + std::random_device seed; + std::default_random_engine generator(seed()); + std::shuffle(osds.begin(), osds.end(), generator); for (uint i = 0 ; i < num_osds ; i++) { if ((float(i + 1) / float(num_osds)) < fratio) { ASSERT_TRUE(osds[i] < num_osds); |