summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/change_stream_pre_image_time_based_expiration_sharded.js
blob: 803bfa45b2d2b43bf4f1efcea3b6fbb5fd6b969b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Tests time-based pre-image retention policy of change stream pre-images remover job.
// @tags: [
//  requires_sharding,
// ]
(function() {
"use strict";

load("jstests/noPassthrough/libs/change_stream_pre_image_time_based_expiration_utils.js");

// Tests pre-image time-based expiration on a sharded cluster.
(function testChangeStreamPreImagesforTimeBasedExpirationOnShardedCluster() {
    const options = {
        mongos: 1,
        config: 1,
        shards: 1,
        rs: {
            nodes: 3,
            // Test expects an exact number of pre-images to be deleted. Thus, the pre-images
            // truncate markers must only contain 1 document at most.
            setParameter: {preImagesCollectionTruncateMarkersMinBytes: 1},
        },
    };
    const st = new ShardingTest(options);
    testTimeBasedPreImageRetentionPolicy(st.s0, st.rs0.getPrimary());
    st.stop();
})();
}());