Skip to content

Commit

Permalink
[TEST] Set logging level in SnapshotResiliencyTests (elastic#106238)
Browse files Browse the repository at this point in the history
* Set logging level in SnapshotResiliencyTests

Some tests check that the expected INFO message
gets logged, so they require setting the level to INFO
for SnapshotsService.

* spotless fixes
  • Loading branch information
kkrik-es authored Mar 12, 2024
1 parent 39779b7 commit bfbb155
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
import org.elasticsearch.test.ClusterServiceUtils;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.MockLogAppender;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.BytesRefRecycler;
import org.elasticsearch.transport.DisruptableMockTransport;
Expand Down Expand Up @@ -1390,6 +1391,7 @@ public <T extends TransportRequest> TransportRequestHandler<T> interceptHandler(
safeAwait(testListener); // shouldn't throw
}

@TestLogging(reason = "testing logging at INFO level", value = "org.elasticsearch.snapshots.SnapshotsService:INFO")
public void testFullSnapshotUnassignedShards() {
setupTestCluster(1, 0); // no data nodes, we want unassigned shards

Expand Down Expand Up @@ -1469,6 +1471,7 @@ public void onFailure(Exception e) {
);
}

@TestLogging(reason = "testing logging at INFO level", value = "org.elasticsearch.snapshots.SnapshotsService:INFO")
public void testSnapshotNameAlreadyInUseExceptionLogging() {
setupTestCluster(1, 1);

Expand Down Expand Up @@ -1519,6 +1522,7 @@ public void onFailure(Exception e) {
);
}

@TestLogging(reason = "testing logging at INFO level", value = "org.elasticsearch.snapshots.SnapshotsService:INFO")
public void testIndexNotFoundExceptionLogging() {
setupTestCluster(1, 0); // no need for data nodes here

Expand Down Expand Up @@ -1571,6 +1575,7 @@ public void onFailure(Exception e) {
);
}

@TestLogging(reason = "testing logging at INFO level", value = "org.elasticsearch.snapshots.SnapshotsService:INFO")
public void testIllegalArgumentExceptionLogging() {
setupTestCluster(1, 0); // no need for data nodes here

Expand Down

0 comments on commit bfbb155

Please sign in to comment.