This is an automated email from the ASF dual-hosted git repository. dsmiley pushed a commit to branch branch_10x in repository https://gitbox.apache.org/repos/asf/solr.git
commit cd746f33bc6581dcda9d5bff224f67962d5424cf Author: Shubham Ranjan <[email protected]> AuthorDate: Wed Jul 15 21:39:43 2026 +0530 SOLR-18294: Fix flaky IndexFetcherPacketProtocolTest (#4624) Test was using an incorrect 'DirContext' and failed periodically based on test randomization. (cherry picked from commit eb59a9a6db4a2ff982a3be8e3682456eb8c12fd1) --- .../test/org/apache/solr/handler/IndexFetcherPacketProtocolTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/core/src/test/org/apache/solr/handler/IndexFetcherPacketProtocolTest.java b/solr/core/src/test/org/apache/solr/handler/IndexFetcherPacketProtocolTest.java index e9d639f1ab3..36d47427a4f 100644 --- a/solr/core/src/test/org/apache/solr/handler/IndexFetcherPacketProtocolTest.java +++ b/solr/core/src/test/org/apache/solr/handler/IndexFetcherPacketProtocolTest.java @@ -227,10 +227,13 @@ public class IndexFetcherPacketProtocolTest extends SolrTestCaseJ4 { /** Writes file content to a directory and serializes it using the replication packet protocol. */ private byte[] serializeFileToPacketStream(byte[] content, String fileName) throws Exception { DirectoryFactory directoryFactory = h.getCore().getDirectoryFactory(); + // Use the same REPLICATION DirContext that the sender (DirectoryFileStream) uses to read the + // file, so the write and the read target the same (unwrapped) delegate Directory. For + // REPLICATION/BACKUP, CachingDirectoryFactory.filterDirectory() unwraps to the raw delegate. Directory dir = directoryFactory.get( h.getCore().getNewIndexDir(), - DirectoryFactory.DirContext.DEFAULT, + DirectoryFactory.DirContext.REPLICATION, h.getCore().getSolrConfig().indexConfig.lockType); try {
