summaryrefslogtreecommitdiff
path: root/jstests/disk
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2023-01-10 19:30:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-10 20:27:15 +0000
commita1013cadfd225e0eaa3a3d4a17597ade7dc8259a (patch)
tree4d93ad4e8ae209eda44799fc86865fd85fe744d3 /jstests/disk
parentdb6db2824bb9aea2692ae09725a2e4dd16c30a82 (diff)
downloadmongo-a1013cadfd225e0eaa3a3d4a17597ade7dc8259a.tar.gz
SERVER-72683 use default timeout when waiting for empty directory removal
Diffstat (limited to 'jstests/disk')
-rw-r--r--jstests/disk/directoryperdb.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/disk/directoryperdb.js b/jstests/disk/directoryperdb.js
index 49c2c89bb0f..84183eae7df 100644
--- a/jstests/disk/directoryperdb.js
+++ b/jstests/disk/directoryperdb.js
@@ -19,6 +19,11 @@ assertDocumentCount = function(db, count) {
* deleted. MongoDB does not always delete data immediately with a catalog change.
*/
const waitForDatabaseDirectoryRemoval = function(dbName, dbDirPath) {
+ // The periodic task to drop data tables for two-phase commit runs once per second and
+ // in standalone mode, without timestamps, can execute table drops immediately. It should
+ // only take a couple seconds for the periodic task to start removing any data tables.
+ // However, slow disk access may delay the actual removal of the directory.
+ // Therefore, we should be conservative and use the default timeout in assert.soon().
assert.soon(
function() {
const files = listFiles(dbDirPath).filter(function(path) {
@@ -31,8 +36,7 @@ const waitForDatabaseDirectoryRemoval = function(dbName, dbDirPath) {
}
},
"dbpath contained '" + dbName +
- "' directory when it should have been removed: " + tojson(listFiles(dbDirPath)),
- 10 * 1000); // The periodic task to run data table cleanup runs once a second.
+ "' directory when it should have been removed: " + tojson(listFiles(dbDirPath)));
};
/**