summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/change_stream_pre_image_time_based_expiration_replset.js
blob: d49a9e333c4c6126964d41d280494468a4303fb3 (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_replication,
// ]
(function() {
"use strict";

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

// Tests pre-image time based expiration on a replica-set.
(function testChangeStreamPreImagesforTimeBasedExpirationOnReplicaSet() {
    const replSetTest = new ReplSetTest({
        name: "replSet",
        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.
        nodeOptions: {setParameter: {preImagesCollectionTruncateMarkersMinBytes: 1}}
    });
    replSetTest.startSet();
    replSetTest.initiate();

    const conn = replSetTest.getPrimary();
    const primary = replSetTest.getPrimary();
    testTimeBasedPreImageRetentionPolicy(conn, primary);
    replSetTest.stopSet();
})();
}());