Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ private static class RevisionsOptions extends Utils.NodeStoreOptions {
.withRequiredArg().ofType(Integer.class).defaultsTo(10000);
fullGcMaxAge = parser.accepts("fullGcMaxAge", "The maximum age of the document in seconds " +
"to be considered for Full GC i.e. Version Garbage Collector (Full GC) logic will only consider those " +
"nodes for Full GC which are not accessed recently (currentTime - lastModifiedTime > fullGcMaxAge)")
.withOptionalArg().ofType(Long.class).defaultsTo(TimeUnit.DAYS.toMillis(1));
"nodes for Full GC which are not accessed recently (currentTime - lastModifiedTime > fullGcMaxAge). Default: 86400 (one day)")
.withOptionalArg().ofType(Long.class).defaultsTo(TimeUnit.DAYS.toSeconds(1));
}

public RevisionsOptions parse(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,27 +191,27 @@ public void fullGC() {
ns.dispose();

String output = captureSystemOut(new RevisionsCmd("fullGC", "--entireRepo"));
assertTrue(output.contains("DryRun is enabled : true"));
assertTrue(output.contains("ResetFullGC is enabled : false"));
assertTrue(output.contains("Compaction is enabled : false"));
assertTrue(output.contains("starting gc collect"));
assertTrue(output.contains("IncludePaths are : [/]"));
assertTrue(output.contains("ExcludePaths are : []"));
assertTrue(output.contains("FullGcMode is : 0"));
assertTrue(output.contains("FullGcDelayFactory is : 2.0"));
assertTrue(output.contains("FullGcBatchSize is : 1000"));
assertTrue(output.contains("FullGcProgressSize is : 10000"));
assertTrue(output.contains("FullGcMaxAgeInSecs is : 86400"));
assertTrue(output.contains("FullGcMaxAgeMillis is : 86400000"));
assertTrue(output.contains("DryRun is enabled : true\n"));
assertTrue(output.contains("ResetFullGC is enabled : false\n"));
assertTrue(output.contains("Compaction is enabled : false\n"));
assertTrue(output.contains("starting gc collect\n"));
assertTrue(output.contains("IncludePaths are : [/]\n"));
assertTrue(output.contains("ExcludePaths are : []\n"));
assertTrue(output.contains("FullGcMode is : 0\n"));
assertTrue(output.contains("FullGcDelayFactory is : 2.0\n"));
assertTrue(output.contains("FullGcBatchSize is : 1000\n"));
assertTrue(output.contains("FullGcProgressSize is : 10000\n"));
assertTrue(output.contains("FullGcMaxAgeInSecs is : 86400\n"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the \n is to ensure the value is exactly 86400 and not something else containing that string, but I wonder if we should then apply the same to the rest of asserts to maintain consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the wrong value was 86400000 and was still passing the test
i've updated the same for all numeric values checks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks tests on Windows systems.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking: why is there a space before the colons?

Copy link
Contributor

@rishabhdaim rishabhdaim Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks tests on Windows systems.

Do we need to change this before CF?

Nitpicking: why is there a space before the colons?

I think this has been done to it consistent with other verifications done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It should be trivial; I'm on it.

  2. Ack.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertTrue(output.contains("FullGcMaxAgeMillis is : 86400000\n"));
}

@Test
public void fullGCWithMaxAgeInSecs() {
ns.dispose();

String output = captureSystemOut(new RevisionsCmd("fullGC", "--fullGcMaxAge", "10000", "--entireRepo"));
assertTrue(output.contains("FullGcMaxAgeInSecs is : 10000"));
assertTrue(output.contains("FullGcMaxAgeMillis is : 10000000"));
assertTrue(output.contains("FullGcMaxAgeInSecs is : 10000\n"));
assertTrue(output.contains("FullGcMaxAgeMillis is : 10000000\n"));
assertTrue(output.contains("starting gc collect"));
}

Expand All @@ -220,7 +220,7 @@ public void fullGCWithDelayFactor() {
ns.dispose();

String output = captureSystemOut(new RevisionsCmd("fullGC", "--fullGcDelayFactor", "2.5", "--entireRepo"));
assertTrue(output.contains("FullGcDelayFactory is : 2.5"));
assertTrue(output.contains("FullGcDelayFactory is : 2.5\n"));
assertTrue(output.contains("starting gc collect"));
}

Expand All @@ -229,7 +229,7 @@ public void fullGCWithBatchSize() {
ns.dispose();

String output = captureSystemOut(new RevisionsCmd("fullGC", "--fullGcBatchSize", "200", "--entireRepo"));
assertTrue(output.contains("FullGcBatchSize is : 200"));
assertTrue(output.contains("FullGcBatchSize is : 200\n"));
assertTrue(output.contains("starting gc collect"));
}

Expand All @@ -238,7 +238,7 @@ public void fullGCWithProgressSize() {
ns.dispose();

String output = captureSystemOut(new RevisionsCmd("fullGC", "--fullGcProgressSize", "20000", "--entireRepo"));
assertTrue(output.contains("FullGcProgressSize is : 20000"));
assertTrue(output.contains("FullGcProgressSize is : 20000\n"));
assertTrue(output.contains("starting gc collect"));
}

Expand Down
Loading