Skip to content

Overhaul MMapDirectory with MemoryMappedViewAccessor, #1013, #1151 - #1267

Closed
paulirwin wants to merge 24 commits into
apache:masterfrom
paulirwin:issue/1013-mmap-redesign
Closed

Overhaul MMapDirectory with MemoryMappedViewAccessor, #1013, #1151#1267
paulirwin wants to merge 24 commits into
apache:masterfrom
paulirwin:issue/1013-mmap-redesign

Conversation

@paulirwin

@paulirwin paulirwin commented Apr 20, 2026

Copy link
Copy Markdown
Contributor
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Overhaul MMapDirectory with MemoryMappedViewAccessor for multi-threaded correctness and performance.

Fixes #1013
Fixes #1151

Description

I was already looking into #1013, going down a different path than this, when @NightOwl888 gave me this good idea in a message related to #1151:

I was looking at the Lucene.NET MMapDirectory yesterday and noted that it wouldn't necessarily have to be based on a ByteBufferIndexInput. It could instead be something like a MemoryMappedViewAccessorIndexInput. If we went that route, we could potentially come up with a more specialized solution. The downsides are of course that it would differ from the Lucene implementation quite a bit and we wouldn't be able to share the concurrency performance improvements with ICU4N without copying them.

After extensively analyzing this with the help of Claude Code (Opus 4.7), I agreed that this was the right approach. This would let us knock out both #1013 crashes and #1151 performance issues at the same time. Going custom also let us drop the upstream Java ByteBufferIndexInput shape entirely and design directly against MemoryMappedViewAccessor + SafeBuffer, which is what .NET actually gives us.

This PR removes the old MMapIndexInput and replaces it with a Lucene.NET-specific nested MMapIndexInput that reads from an array of memory-mapped chunks via cached raw pointers. It uses unsafe for the hot path and inherits directly from IndexInput rather than BufferedIndexInput so that ReadByte / ReadInt16 / ReadInt32 / ReadInt64 go straight to the cached chunk pointer with a single bounds check: no managed-buffer indirection. ReadVInt32, ReadVInt64, ReadString, etc. inherit from DataInput and call our fast ReadByte, so they pick up the speedup automatically.

The file is mapped as an array of fixed-size Chunks (default 1 GiB on 64-bit), each owning one MemoryMappedViewAccessor. Concurrency is handled by a per-chunk rent count + closed flag packed into a single int: a reader holds a "rent" on the chunk for as long as it has the chunk's pointer cached (i.e. between chunk crossings, or until Seek / Dispose). Chunk.Close flips the closed bit immediately, but the actual UnmapViewOfFile / munmap is deferred until every outstanding rent has been released. This is the "lazy unmap" pattern: Close never blocks waiting for readers, no SpinWait, and a reader's cached pointer stays valid for as long as it hasn't released. AVEs are structurally impossible because the unmap can't run while any rent is outstanding — fixing #1013 by construction rather than by retry.

The reader's fast path is just pos < currentEnd followed by *(readBase + pos)readBase is precomputed at chunk-acquire time so the single hot-path load doesn't have to add baseOffset or subtract chunkFileStart. ReadBytes uses Unsafe.CopyBlockUnaligned between cached pointer and destination span, with chunk crossings handled in the loop. This is what restores the performance lost in #1151.

SharedMapping owns the underlying MemoryMappedFile + FileStream + chunk array and is shared between a root MMapIndexInput and its clones, OR between a slicer and its issued slices and their clones. Only the root / slicer disposes the mapping; clones and slices piggyback on its lifetime. Cross-thread Dispose (e.g. slicer.Dispose tearing down slices being read on other threads — the #1013 scenario) is handled by clearing currentEnd to 0 atomically from any thread; the reader's next call falls into the slow path and observes the closed state, then releases its own rent on its own thread before throwing AlreadyClosedException.

Benchmarks

Built a Wikipedia-corpus benchmark (~22.5K docs from enwiki-multistream1, 924 MB index, 3 segments) and ran it across three implementations on Apple M4 Max:

  • Java 4.8.1 — JMH, OpenJDK 21
  • .NET PR branch — this PR
  • .NET Lucene.Net 4.8.0-beta00017 — the current released version
Benchmark Java 4.8.1 PR beta17 PR vs beta17
OpenAndClose 0.91 ms 3.04 ms 4.18 ms 1.38×
TermQueryCommon 1.2 µs 2.2 µs 4.4 µs 2.0×
TermQueryRare 1.9 µs 3.7 µs 6.8 µs 1.9×
PhraseQuery 1.29 ms 1.59 ms 2.04 ms 1.28×
BooleanQuery 143 µs 228 µs 247 µs 1.08×
WildcardQuery 71 µs 83 µs 128 µs 1.54×
ConcurrentSearch8 (8 threads × 50 iters) 3.99 ms 5.50 ms 21.28 ms 3.87×
FullScan (22.5K stored-field reads) 1984 ms 1590 ms 3392 ms 2.13× (PR also beats Java 1.25×)

Key findings

  1. Search crash #1013 / Search performance issue with MMapDirectory under load #1151 are fixed. ConcurrentSearch8 — the workload that actually exercises shared IndexSearcher access across threads — is 3.87× faster than beta17. The contention pattern is gone.
  2. PR is faster than beta17 across the board (1.08×–3.87×). No benchmark regresses.
  3. PR beats Java on FullScan (1590 ms vs 1984 ms). FullScan is the most byte-throughput-sensitive workload in the suite — every doc requires LZ4 decompression of stored fields — and it's exactly what the cached-pointer fast path was built for. Holds under both Workstation and Server GC modes.
  4. The remaining gap to Java on small queries is not MMap-related. I verified this with an A/B against NIOFSDirectory on the same .NET build: NIOFS is slower than MMap on every benchmark, and the .NET-vs-Java ratio is essentially identical with either directory. The remaining gap lives in higher layers (SegmentReader open path, Term dictionary lookup, per-query allocation), not in the Directory.

Unit Tests

This PR adds extensive unit tests in TestMultiMMap to cover not only the #1013 issue (which was confirmed fixed via TDD) but also a wide range of real and hypothetical race conditions: cross-thread Dispose during reads, slicer-Dispose-while-slices-being-read, post-dispose clone, double-dispose idempotency, chunk-boundary crossings for every read entry point (ReadByte, ReadInt16/32/64, ReadVInt32/64, ReadBytes, Seek, SkipBytes), sliced-read across boundaries with non-zero base offsets, capacity-retry under concurrent file extension (#1090), and zero-length-file edge cases. A final review pass added a few more (out-of-bounds slice rejection, clone-after-root-dispose fail-fast, 32-bit-safe atomic dispose signal). All existing 10k+ tests pass on .NET 8–10 on macOS (except for an unrelated lucene-cli one I'll fix separately).

AI: This PR was co-authored with Claude Code (Opus 4.7).

@paulirwin paulirwin added the notes:breaking-change Has changes that will break backward compatibility label Apr 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR overhauls MMapDirectory’s read path by replacing the prior ByteBufferIndexInput-based implementation with a new BufferedIndexInput-based MemoryMappedViewAccessorIndexInput that caches an unmanaged pointer for faster reads and adds concurrency coordination to avoid access violations under concurrent disposal.

Changes:

  • Introduces MemoryMappedViewAccessorIndexInput with a shared, refcounted View that coordinates concurrent reads vs. disposal and performs bulk refills via Unsafe.CopyBlockUnaligned.
  • Updates MMapDirectory to construct the new IndexInput and revises IndexInputSlicer behavior (including cascade disposal of issued slices).
  • Adds targeted concurrency/race regression tests and re-links 3.x CFS embedded fixtures for OpenFullSlice coverage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/Lucene.Net/Store/MemoryMappedViewAccessorIndexInput.cs New BufferedIndexInput implementation backed by MemoryMappedViewAccessor + cached pointer and a shared View lifecycle model.
src/Lucene.Net/Store/MMapDirectory.cs Switches MMap reads to the new input type and refactors slicer/slice disposal behavior.
src/Lucene.Net.Tests/Store/TestMultiMMap.cs Adds stress/regression tests for concurrent clone/read/dispose and 3.x CFS OpenFullSlice paths.
src/Lucene.Net.Tests._J-S/Lucene.Net.Tests._J-S.csproj Adds embedded 3.x index zip fixtures into the Store namespace for the new tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net/Store/MemoryMappedViewAccessorIndexInput.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs

@NightOwl888 NightOwl888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall, this looks like a very positive direction. The new battery of tests is very impressive, although I flagged several issues of Random usage that will affect reliability of repeating test conditions and test performance. And it seems like the chunking behavior of Lucene is worth pursuing. See my inline comments.

Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
Comment thread src/Lucene.Net.Tests/Store/TestMultiMMap.cs Outdated
@paulirwin
paulirwin requested a review from NightOwl888 April 23, 2026 14:05

@NightOwl888 NightOwl888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking really good. The chunking fuctionality seems really solid.

I found a few areas where we might be able to squeeze more performance out of the implementation, and they sound reasonable on the surface, but it will be interesting to see whether the improvements are viable or if this design is what we end up with.

Naming

Just a note on this. IMO, it seems like we should aim to rename some types in the Store namespace to make this app feel less alien to .NET users. The first time I saw NIOFSDirectory, I was wondering if I could use it to read files from the matrix. I think using the .NET names would be more sensible.

  • SimpleFSDirectory -> FileStreamDirectory (it is based on FileStream)
  • NIOFSDirectory -> RandomAccessDirectory (it is based on RandomAccess in .NET Core)
  • MMapDirectory -> MemoryMappedFileDirectory
  • FSDirectory -> FileSystemDirectory (if FS doesn't stand for file system, then I have justified my aversion to using abbreviations)

But none of that has to be done in this PR.

Comment thread src/Lucene.Net/Store/MemoryMappedViewAccessorIndexInput.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MemoryMappedViewAccessorIndexInput.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated

@NightOwl888 NightOwl888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the churn on this PR, but this is such a critical piece of infrastructure it is important we do some due diligence on it. This isn't a reflection on the work you are doing on it - the code quality on this is excellent.

Unfortunately, ChatGPT let us down this time by contradicting its own advice. It seems to be a feature (not a bug) of AI to disagree with itself. I double-checked this time to see if whether this new advice meets all of the Lucene 4.8.0 requirements and nothing was flagged that was significant enough to worry about that this new advice isn't already functionally correct for. But it wouldn't hurt to check again.

Comment thread src/Lucene.Net/Store/MMapDirectory.cs
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
@paulirwin
paulirwin marked this pull request as draft April 25, 2026 12:57
@paulirwin
paulirwin force-pushed the issue/1013-mmap-redesign branch from 02d9142 to 899ec1f Compare April 26, 2026 20:33
@paulirwin
paulirwin marked this pull request as ready for review April 26, 2026 20:58
@paulirwin

Copy link
Copy Markdown
Contributor Author

@NightOwl888 This is ready for re-review. The implementation of MMapIndexInput has been overhauled to remove BufferedIndexInput as the base class and implement IndexInput directly. This lets us go straight to (unsafe) memory for raw byte access, rather than having to buffer everything in managed memory first, for some additional performance gains. See the benchmarks in the updated PR description: raw tight-loop I/O of Document(int docID) including byte-throughput-sensitive LZ4 decompression is now 25% faster than Java!

Also the fix for #1090 was re-imagined by using capacity: 0 to remove the length race. This is confirmed via the tests, and simplifies the code a bit.

The prior attempt at caching the MemoryMappedFile instances showed negligible performance benefit, within noise. Looking at the code path, Lucene callers typically don't open the same file repeatedly, so the cache's micro-benefit doesn't translate to real workloads. Without the cache we also get closer parity with the upstream Java Lucene code (even while beating it in performance for raw throughput), and we don't have stale-length divergence concerns.

@NightOwl888 NightOwl888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code quality and implementation looks pretty good overall.

But, this time I attempted to run the tests and ran into some problems. I tried 2 different times, but the test runner crashed after running only ~3300 tests even though I selected all of them to run. According to the log, the test framework is unable to cleanup files because they are locked.

I ran these tests as 64 bit runtime on 64-bit Windows.

Test Log
========== Starting test run ==========
NUnit Adapter 4.6.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests._J-S\bin\Debug\net10.0\Lucene.Net.Tests._J-S.dll
   NUnit3TestExecutor discovered 1525 of 1525 NUnit test cases using Current Discovery mode, Non-Explicit run
TestMultithreadedWaitForGeneration: Run Manually (contains timing code that doesn't play well with other tests)
TestStraightForwardDemonstration: Run Manually (contains timing code that doesn't play well with other tests)
TestMultiSloppyWithRepeats: This appears to be a known issue
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestSearcherManager:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_9.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_a.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestShardSearching:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-mgq5zmof\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-mgq5zmof\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-mgq5zmof\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-mgq5zmof\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-mgq5zmof
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-i2zc3xqn\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-i2zc3xqn\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-i2zc3xqn\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-i2zc3xqn\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-i2zc3xqn

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestSloppyPhraseQuery:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-rarimd1z\_0.frq
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-rarimd1z\_0.prx
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-rarimd1z\_0.tis
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-rarimd1z

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
Verbosity disabled. Enable manually if needed.

Verbosity disabled. Enable manually if needed.

C:\Users\shad\AppData\Local\Temp\LuceneTemp\nocreate-pffsgfqk

[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestDirectory:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-4zsj5v0f\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-4zsj5v0f\_0.cfx
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-4zsj5v0f

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
TestOpenInputConcurrentFileExtension: completed 40 OpenInput calls in 5,1s
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestMultiMMap:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap81-y0avi0u4\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap81-y0avi0u4\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap81-y0avi0u4\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap81-y0avi0u4\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap81-y0avi0u4
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-r31ldksu\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-r31ldksu
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-fnkalhln\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-fnkalhln\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-fnkalhln\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-fnkalhln\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap67-fnkalhln
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap66-ws223lhu\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap66-ws223lhu
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap29-uqn0u2xa\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap29-uqn0u2xa
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap25-43qtl4cp\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap25-43qtl4cp\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap25-43qtl4cp\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap25-43qtl4cp\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap25-43qtl4cp
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-z0um4qv2\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-z0um4qv2\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-z0um4qv2\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-z0um4qv2\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-z0um4qv2
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap97-uxhxiwy2\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap97-uxhxiwy2
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap74-gowmdlhi\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap74-gowmdlhi
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-fdguui1c\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-fdguui1c\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-fdguui1c
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\postXDispose-vcy04xoy\f
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\postXDispose-vcy04xoy
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testMultipleSlicesDistinct-yxx0dhhi\bytes
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testMultipleSlicesDistinct-yxx0dhhi
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testConcurrentClonesIntegrity-i0dh1cue\bytes
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testConcurrentClonesIntegrity-i0dh1cue

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestNRTCachingDirectory:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_k_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu\_l_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-yywokzpu

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during RandomizedContext.DisposeResources() in Lucene.Net.Store.TestRAMDirectory:
NUnit.Framework.AssertionException: Directory not disposed: MockDirectoryWrapper(MMapDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.Fail(String message, Object[] args)
   at NUnit.Framework.Assert.Fail(String message)
   at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
--- End of stack trace from previous location ---
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 265
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050
Caller Details:
Scope: SUITE
Thread Name: .NET TP Worker
Stack Trace:   at Lucene.Net.Util.LuceneTestCase.WrapDirectory(Random random, Directory directory, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d)
   at Lucene.Net.Store.TestRAMDirectory.SetUp()
   at InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.InvokeMethod(IMethodInfo method, TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TimeoutCommand.<>c__DisplayClass5_0.<RunTestOnSeparateThread>b__0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()


TearDown failed for test fixture Lucene.Net.Store.TestRAMDirectory
Directory not disposed: MockDirectoryWrapper(MMapDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
TearDown : NUnit.Framework.AssertionException : Directory not disposed: MockDirectoryWrapper(MMapDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
Data:
  _RandomizedContext_Scope: SUITE
  _RandomizedContext_ThreadName: .NET TP Worker
  _RandomizedContext_StackTrace:    at Lucene.Net.Util.LuceneTestCase.WrapDirectory(Random random, Directory directory, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d)
   at Lucene.Net.Store.TestRAMDirectory.SetUp()
   at InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.InvokeMethod(IMethodInfo method, TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TimeoutCommand.<>c__DisplayClass5_0.<RunTestOnSeparateThread>b__0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

  Lucene_SuppressedExceptions: []
StackTrace:    at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050

--TearDown
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.Fail(String message, Object[] args)
   at NUnit.Framework.Assert.Fail(String message)
   at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
--- End of stack trace from previous location ---
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 265
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050
   at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
TestThreadInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.
TestTwoThreadsInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.
TestLockInterruptibly1: LUCENENET: LockInterruptibly() is broken, but it is not in use anywhere but in the tests. Technically, Lucene.NET does not support Thread.Interrupt().
TestToString: LUCENENET: Not implemented
TestEquals: ConcurrentHashSet does not currently implement structural Equals
NUnit Adapter 4.6.0.0: Test execution complete
NUnit Adapter 1.0.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests.AllProjects\bin\Debug\net10.0\Lucene.Net.Tests.AllProjects.dll
   NUnit3TestExecutor discovered 1798 of 1798 NUnit test cases using Current Discovery mode, Non-Explicit run
TestIsError(NUnit.Framework.SuccessException,False,System.Action): Throwing a SuccessException.
TestIsThrowable(NUnit.Framework.SuccessException,False,System.Action): Throwing a SuccessException.
NUnit Adapter 1.0.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests.Analysis.OpenNLP\bin\Debug\net10.0\Lucene.Net.Tests.Analysis.OpenNLP.dll
   NUnit3TestExecutor discovered 26 of 26 NUnit test cases using Current Discovery mode, Non-Explicit run
========== Test run finished: 3349 Tests (3331 Passed, 4 Failed, 8 Skipped) run in 3.2 min ==========
Building Test Projects
========== Starting test run ==========
NUnit Adapter 4.6.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests._J-S\bin\Debug\net10.0\Lucene.Net.Tests._J-S.dll
   NUnit3TestExecutor discovered 1525 of 1525 NUnit test cases using Current Discovery mode, Non-Explicit run
TestSimple2:   Broken scoring: LUCENE-3723
  Expected: True
  But was:  False

TestSpans2:   Broken scoring: LUCENE-3723
  Expected: True
  But was:  False

TestMultithreadedWaitForGeneration: Run Manually (contains timing code that doesn't play well with other tests)
TestStraightForwardDemonstration: Run Manually (contains timing code that doesn't play well with other tests)
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestControlledRealTimeReopenThread:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_MockSep_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_MockSep_0.frq
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_MockSep_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_MockSep_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_f0_MockSep_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_fb.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_fc.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_fd.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo\_fe.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-a2njg0uo

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
TestMultiSloppyWithRepeats: This appears to be a known issue
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestSearcherManager:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_0_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_1_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_2_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_3_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_4_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_5_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_6_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_7_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_8.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_9_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51\_a_Lucene45_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-xaiwdq51

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestShardSearching:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_4.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_5.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc\_6.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-ocwlx5vc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s\_4.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s\_5.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-bvp0ia2s
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-gld0gplw\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-gld0gplw\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-gld0gplw\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-gld0gplw\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-gld0gplw\_4.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-gld0gplw
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf\_4.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf\_5.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-pms0b0vf
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-2tit1nlb\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-2tit1nlb\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-2tit1nlb

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestSloppyPhraseQuery:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-uaoisk3s\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-uaoisk3s\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-uaoisk3s\_0_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-uaoisk3s\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-uaoisk3s\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-uaoisk3s

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestSort:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-okznvvpt\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-okznvvpt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-10rjgoaj\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-10rjgoaj\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-10rjgoaj\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-10rjgoaj\_0.tvf
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-10rjgoaj

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
Verbosity disabled. Enable manually if needed.

Verbosity disabled. Enable manually if needed.

C:\Users\shad\AppData\Local\Temp\LuceneTemp\nocreate-stbjuhll

[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestDirectory:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-2uatwy23\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-2uatwy23\_0.cfx
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-2uatwy23

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
TestOpenInputConcurrentFileExtension: completed 39 OpenInput calls in 5.1s
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestMultiMMap:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap94-yqwj0l0v\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap94-yqwj0l0v\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap94-yqwj0l0v\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap94-yqwj0l0v\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap94-yqwj0l0v
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_1.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_1_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_1_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5\_1_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap70-ybqf5ze5
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap43-hqfwp0bq\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap43-hqfwp0bq\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap43-hqfwp0bq\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap43-hqfwp0bq\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap43-hqfwp0bq
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap33-x0lvtuhs\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap33-x0lvtuhs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap30-2axy2ju1\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap30-2axy2ju1\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap30-2axy2ju1
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap23-du4rdxa0\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap23-du4rdxa0
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap47-wzomklzq\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap47-wzomklzq
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap41-4qtaa2b4\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap41-4qtaa2b4\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap41-4qtaa2b4\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap41-4qtaa2b4\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap41-4qtaa2b4
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap75-pp1gdb0c\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap75-pp1gdb0c
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap38-rtiolc0e\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap38-rtiolc0e\_0_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap38-rtiolc0e\_0_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap38-rtiolc0e\_0_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap38-rtiolc0e
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap27-cs3lu1er\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap27-cs3lu1er
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\postXDispose-a4czyga0\f
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\postXDispose-a4czyga0
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testMultipleSlicesDistinct-kekrgrec\bytes
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testMultipleSlicesDistinct-kekrgrec
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testConcurrentClonesIntegrity-2k2t520a\bytes
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testConcurrentClonesIntegrity-2k2t520a

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during RandomizedContext.DisposeResources() in Lucene.Net.Store.TestRAMDirectory:
NUnit.Framework.AssertionException: Directory not disposed: MockDirectoryWrapper(SimpleFSDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.Fail(String message, Object[] args)
   at NUnit.Framework.Assert.Fail(String message)
   at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
--- End of stack trace from previous location ---
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 265
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050
Caller Details:
Scope: SUITE
Thread Name: .NET TP Worker
Stack Trace:   at Lucene.Net.Util.LuceneTestCase.WrapDirectory(Random random, Directory directory, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d)
   at Lucene.Net.Store.TestRAMDirectory.SetUp()
   at InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.InvokeMethod(IMethodInfo method, TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TimeoutCommand.<>c__DisplayClass5_0.<RunTestOnSeparateThread>b__0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()


TearDown failed for test fixture Lucene.Net.Store.TestRAMDirectory
Directory not disposed: MockDirectoryWrapper(SimpleFSDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
TearDown : NUnit.Framework.AssertionException : Directory not disposed: MockDirectoryWrapper(SimpleFSDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
Data:
  _RandomizedContext_Scope: SUITE
  _RandomizedContext_ThreadName: .NET TP Worker
  _RandomizedContext_StackTrace:    at Lucene.Net.Util.LuceneTestCase.WrapDirectory(Random random, Directory directory, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d)
   at Lucene.Net.Store.TestRAMDirectory.SetUp()
   at InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.InvokeMethod(IMethodInfo method, TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TimeoutCommand.<>c__DisplayClass5_0.<RunTestOnSeparateThread>b__0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

  Lucene_SuppressedExceptions: []
StackTrace:    at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050

--TearDown
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.Fail(String message, Object[] args)
   at NUnit.Framework.Assert.Fail(String message)
   at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
--- End of stack trace from previous location ---
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 265
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050
   at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
TestThreadInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.
TestTwoThreadsInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.
TestLockInterruptibly1: LUCENENET: LockInterruptibly() is broken, but it is not in use anywhere but in the tests. Technically, Lucene.NET does not support Thread.Interrupt().
TestToString: LUCENENET: Not implemented
TestEquals: ConcurrentHashSet does not currently implement structural Equals
NUnit Adapter 4.6.0.0: Test execution complete
NUnit Adapter 1.0.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests.AllProjects\bin\Debug\net10.0\Lucene.Net.Tests.AllProjects.dll
   NUnit3TestExecutor discovered 1798 of 1798 NUnit test cases using Current Discovery mode, Non-Explicit run
TestIsError(NUnit.Framework.SuccessException,False,System.Action): Throwing a SuccessException.
TestIsThrowable(NUnit.Framework.SuccessException,False,System.Action): Throwing a SuccessException.
NUnit Adapter 1.0.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests.Analysis.OpenNLP\bin\Debug\net10.0\Lucene.Net.Tests.Analysis.OpenNLP.dll
   NUnit3TestExecutor discovered 26 of 26 NUnit test cases using Current Discovery mode, Non-Explicit run
========== Test run finished: 3349 Tests (3330 Passed, 3 Failed, 8 Skipped) run in 3.8 min ==========

I also got some test failures that look like they are also due to locked files.

Test Failures (4)
 TestSearcherManager_Mem
   Source: TestSearcherManager.cs line 56
   Duration: 4.6 sec

  Message: 
System.IO.IOException : Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_0_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_1_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_2_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_3_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_4_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_FSTOrdPulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_FSTOrdPulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.tib
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Lucene41WithOrds_0.tii
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_5_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_6_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_7_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8.tvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Asserting_0.dvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_FSTOrdPulsing41_0.tbk
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_1.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_8_Pulsing41_1.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_9.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2\_a.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\TestSearcherManager-wsicwfr2

(Test: Lucene.Net.Search.TestSearcherManager.TestSearcherManager_Mem)

To reproduce this test result:

Option 1:

 Apply the following assembly-level attributes:

[assembly: Lucene.Net.Util.RandomSeed("0xb784c5365e4c68a1:0x1ea5618db4d46c30")]
[assembly: NUnit.Framework.SetCulture("es-CR")]

Option 2:

 Use the following .runsettings file:

<RunSettings>
  <TestRunParameters>
    <Parameter name="tests:seed" value="0xb784c5365e4c68a1:0x1ea5618db4d46c30" />
    <Parameter name="tests:culture" value="es-CR" />
  </TestRunParameters>
</RunSettings>

Option 3:

 Create the following lucene.testsettings.json file somewhere between the test assembly and the root of your drive:

{
  "tests": {
     "seed": "0xb784c5365e4c68a1:0x1ea5618db4d46c30",
     "culture": "es-CR"
  }
}

Fixture Test Values
=================

 Random Seed:           0xb784c5365e4c68a1:0x1ea5618db4d46c30
 Culture:               es-CR
 Time Zone:             (UTC+13:00) Samoa
 Default Codec:         Lucene46 (RandomCodec)
 Default Similarity:    RandomSimilarityProvider(queryNorm=False,coord=yes): {body=IB SPL-L2, extra36=DFR I(ne)1, titleTokenized=DFR GB3(800), extra30=DFR GL3(800), extra32=DFR I(n)B2, extra34=DFR I(ne)3(800), extra13=DFR I(F)Z(0,3), extra37=DFR I(F)B3(800), extra19=DFR G3(800), extra1=IB LL-D3(800), extra18=DFR I(n)L3(800), extra23=IB SPL-LZ(0,3), extra29=DFR GBZ(0,3), extra12=LM Jelinek-Mercer(0,1), extra6=DFR I(F)3(800), extra31=IB SPL-D1, extra17=DFR I(F)BZ(0,3), extra25=IB SPL-L2, extra14=IB SPL-D3(800), extra38=DFR I(ne)B3(800), extra3=DFR I(n)3(800), extra7=DFR GB1, extra22=DFR I(n)LZ(0,3), extra8=DFR I(n)B1}

System Properties
=================

 Nightly:               False
 Weekly:                False
 Slow:                  True
 Awaits Fix:            True
 Directory:             random
 Verbose:               False
 Random Multiplier:     1


  Stack Trace: 
TestUtil.Rm(FileSystemInfo[] locations) line 66
ThreadedIndexingAndSearchingTestCase.RunTest(String testName) line 789
TestSearcherManager.TestSearcherManager_Mem() line 59
RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)



-------------------------------------------------------------------------------

 TestRAMDirectoryMem
   Source: TestRAMDirectory.cs line 80
   Duration: 178 ms

  Message: 
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
--TearDown
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
InvokeStub_TestRAMDirectory.TearDown(Object, Object, IntPtr*)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

-------------------------------------------------------------------------------

 TestRAMDirectorySize
   Source: TestRAMDirectory.cs line 113
   Duration: 63 ms

  Message: 
System.IO.IOException : Cannot overwrite: C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
FSDirectory.EnsureCanWrite(String name) line 385
FSDirectory.CreateOutput(String name, IOContext context) line 358
MockDirectoryWrapper.CreateOutput(String name, IOContext context) line 716
TrackingDirectoryWrapper.CreateOutput(String name, IOContext context) line 46
CompoundFileWriter.GetOutput() line 112
CompoundFileWriter.CreateOutput(String name, IOContext context) line 274
CompoundFileDirectory.CreateOutput(String name, IOContext context) line 411
Directory.Copy(Directory to, String src, String dest, IOContext context) line 202
--- End of stack trace from previous location ---
Directory.Copy(Directory to, String src, String dest, IOContext context) line 215
Directory.Copy(Directory to, String src, String dest, IOContext context) line 196
MockDirectoryWrapper.Copy(Directory to, String src, String dest, IOContext context) line 1361
TrackingDirectoryWrapper.Copy(Directory to, String src, String dest, IOContext context) line 52
IndexWriter.CreateCompoundFile(InfoStream infoStream, Directory directory, CheckAbort checkAbort, SegmentInfo info, IOContext context) line 6292
DocumentsWriterPerThread.SealFlushedSegment(FlushedSegment flushedSegment) line 618
DocumentsWriterPerThread.Flush() line 580
DocumentsWriter.DoFlush(DocumentsWriterPerThread flushingDWPT) line 650
DocumentsWriter.FlushAllThreads(IndexWriter indexWriter) line 797
IndexWriter.DoFlush(Boolean applyAllDeletes) line 4266
IndexWriter.Flush(Boolean triggerMerge, Boolean applyAllDeletes) line 4234
IndexWriter.CloseInternal(Boolean waitForMerges, Boolean doFlush) line 1293
IndexWriter.Dispose(Boolean disposing, Boolean waitForMerges) line 1184
IndexWriter.Dispose() line 1097
TestRAMDirectory.SetUp() line 75
InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--TearDown
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
InvokeStub_TestRAMDirectory.TearDown(Object, Object, IntPtr*)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

-------------------------------------------------------------------------------

 TestSeekToEOFThenBack
   Source: TestRAMDirectory.cs line 243
   Duration: 1.6 sec

  Message: 
Lucene.Net.Store.LockObtainFailedException : Lock obtain timed out: Lucene.Net.Store.MockLockFactoryWrapper+MockLock
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
Lock.Obtain(Int64 lockWaitTimeout) line 138
IndexWriter.ctor(Directory d, IndexWriterConfig conf) line 871
TestRAMDirectory.SetUp() line 65
InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--TearDown
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
InvokeStub_TestRAMDirectory.TearDown(Object, Object, IntPtr*)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

-------------------------------------------------------------------------------

I couldn't find anything technically incorrect in the main paths, but I think the Dispose() paths need some more buttoning up to ensure they are either done in a try/finally block or commented to indicate why it is unnecessary. It seems brittle to leave off the try/finally because that means all callers may break if the implementation later changes to where it could throw. It is also important to make sure the secondary exceptions are caught and attached to the primary one before rethrowing for debugging purposes using the overload of IOUtils.DisposeWhileHandlingException unless we intend to completely suppress those errors as noise.

The rest of my comments amount to micro-optimizations that I think we should implement to squeeze every last bit of performance out of this design as possible.

We should use string interpolation everywhere for formatting, but I only added some comments about doing it on the hot paths.

There is also a more efficient way we can share an implementation between byte[] and Span<byte> overloads and I provided a couple of options.

Comment thread src/Lucene.Net/Store/MMapDirectory.cs
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
Comment thread src/Lucene.Net/Store/MMapDirectory.cs
Comment thread src/Lucene.Net/Store/MMapDirectory.cs Outdated
@NightOwl888

Copy link
Copy Markdown
Contributor

BTW - I should also note that Lucene uses exceptions quite a bit for control flow. This is the primary reason why we mapped the .NET exceptions to Java exceptions and created throw and catch helpers to ensure we send the right signals through and they reach the right destination. I think it would be extremely difficult to analyze all of the exceptions at a high level and try to find a way to change that to control flow methods/messages/events, so we just replicated the exceptions as-is and mapped them to their logical .NET counterparts.

So, we need to be extra vigilant about reviewing exceptions to make sure we are throwing when we should, what we should, and swallowing when we should. Including exceptions thrown from the BCL. IndexWriter in particular has common exception blocks that must be run for certain operations to happen. Fortunately, we can take some cues from the old MMapDirectory implementation which seemed to properly throw the right exceptions at the right times.

@paulirwin

Copy link
Copy Markdown
Contributor Author

Aside: MyGet is having some issues today, getting regular test failures on restore. And pushing up a fix for the naming failure now.

Meanwhile, here are the latest benchmarks, didn't improve much with the latest changes, but it's consistently beating Java in the I/O heavy search, and beating beta 17 across the board:

Benchmark Java 4.8.1 PR (this branch) beta17 PR vs Java PR vs beta17
openAndClose 0.929 ms 3.077 ms 4.515 ms 3.31× slower 1.47× faster
termQueryCommon 0.001 ms 0.0022 ms 0.0045 ms ~2.2× slower 2.05× faster
termQueryRare 0.002 ms 0.0036 ms 0.0069 ms ~1.8× slower 1.92× faster
phraseQuery 1.286 ms 1.608 ms 1.984 ms 1.25× slower 1.23× faster
booleanQuery 0.147 ms 0.239 ms 0.259 ms 1.63× slower 1.08× faster
wildcardQuery 0.069 ms 0.0888 ms 0.128 ms 1.29× slower 1.44× faster
concurrentSearch8 4.048 ms 5.548 ms 20.865 ms 1.37× slower 3.76× faster
fullScan 1996.94 ms 1670.41 ms 3560.10 ms 1.20× faster 2.13× faster

@paulirwin

Copy link
Copy Markdown
Contributor Author

All PR comments have been resolved, ready for re-review. I also rebased this on latest master.

Unit tests now pass reliably on Windows over several full runs for me on Windows x64. That .NET Framework capacity bug reared its ugly head yet again, so I added some retry logic to it. (I hope this is an example for everyone of the bug fixes that you're not getting by staying on .NET Framework. This is a framework bug, that is fixed in modern .NET!) Quick explanation: .NET Framework repeatedly checks FileStream.Length instead of storing it to a variable like modern .NET does, which can cause race conditions when the length is changing when opening a mmap file (and the unit test purposefully tests this). You'd think this would be ephemeral and hard to test, but our unit test reliably catches it.

@NightOwl888 NightOwl888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tried the tests again, but these changes didn't seem to improve the situation, but also didn't really make things worse AFAICT. There is noticeable contention for resources when running the tests. On master, a test run of Lucene.Net.Tests._J-S (even in debug mode) will take around 2 or so minutes on my machine. But now it is taking 7.5 minutes.

Image

I also ran the tests for A-D and also got some failures there, but the above 4 are the same tests that failed before. I am also still seeing lots of files left on disk in the test log.

Details Codec test failues
 TestRandom
  No source available
   Duration: 104 ms

  Message: 
System.UnauthorizedAccessException : Access to the path '_0_Lucene40_0.frq' is denied.
(Test: Lucene.Net.Codecs.Lucene40.TestLucene40PostingsFormat.TestRandom)

To reproduce this test result:

Option 1:

 Apply the following assembly-level attributes:

[assembly: Lucene.Net.Util.RandomSeed("0xaa433b53adf32628:0xe67792952cbc5756")]
[assembly: NUnit.Framework.SetCulture("br")]

Option 2:

 Use the following .runsettings file:

<RunSettings>
  <TestRunParameters>
    <Parameter name="tests:seed" value="0xaa433b53adf32628:0xe67792952cbc5756" />
    <Parameter name="tests:culture" value="br" />
  </TestRunParameters>
</RunSettings>

Option 3:

 Create the following lucene.testsettings.json file somewhere between the test assembly and the root of your drive:

{
  "tests": {
     "seed": "0xaa433b53adf32628:0xe67792952cbc5756",
     "culture": "br"
  }
}

Fixture Test Values
=================

 Random Seed:           0xaa433b53adf32628:0xe67792952cbc5756
 Culture:               br
 Time Zone:             (UTC+11:00) Bougainville Island
 Default Codec:         CheapBastard (CheapBastardCodec)
 Default Similarity:    DefaultSimilarity

System Properties
=================

 Nightly:               False
 Weekly:                False
 Slow:                  True
 Awaits Fix:            True
 Directory:             random
 Verbose:               False
 Random Multiplier:     1


  Stack Trace: 
FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
BasePostingsFormatTestCase.TestRandom() line 1344
RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

 TestRandom
  No source available
   Duration: 155 ms

  Message: 
System.UnauthorizedAccessException : Access to the path '_0_MockSep_0.doc' is denied.
(Test: Lucene.Net.Codecs.PerField.TestPerFieldPostingsFormat.TestRandom)

To reproduce this test result:

Option 1:

 Apply the following assembly-level attributes:

[assembly: Lucene.Net.Util.RandomSeed("0xeae8513e1f6bac9d:0xf8dc1bac315e4358")]
[assembly: NUnit.Framework.SetCulture("en-SZ")]

Option 2:

 Use the following .runsettings file:

<RunSettings>
  <TestRunParameters>
    <Parameter name="tests:seed" value="0xeae8513e1f6bac9d:0xf8dc1bac315e4358" />
    <Parameter name="tests:culture" value="en-SZ" />
  </TestRunParameters>
</RunSettings>

Option 3:

 Create the following lucene.testsettings.json file somewhere between the test assembly and the root of your drive:

{
  "tests": {
     "seed": "0xeae8513e1f6bac9d:0xf8dc1bac315e4358",
     "culture": "en-SZ"
  }
}

Fixture Test Values
=================

 Random Seed:           0xeae8513e1f6bac9d:0xf8dc1bac315e4358
 Culture:               en-SZ
 Time Zone:             (UTC+09:00) Yakutsk
 Default Codec:         Lucene40 (Lucene40RWCodec)
 Default Similarity:    DefaultSimilarity

System Properties
=================

 Nightly:               False
 Weekly:                False
 Slow:                  True
 Awaits Fix:            True
 Directory:             random
 Verbose:               False
 Random Multiplier:     1


  Stack Trace: 
FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
BasePostingsFormatTestCase.TestRandom() line 1344
RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Next Steps

Here is my suggestion. The goal is to compare this branch either with a known working copy of Lucene.NET (master or even go back to beta 17) or Lucene, enable verbose logging, and then run those logs through AI to have them analyzed. I haven't used verbose logging in a really long time and it used to crash Visual Studio in some cases. But the way it works is that it attaches an InfoStream (or StreamWriter) to various objects and if it is set, it will output logs, so you could alternatively hook into it yourself and log to disk instead of having the test framework write it to the test output.

It would probably be best to use master so the recent changes to the random seed behavior when the implementation of the [Repeat] attribute don't taint the data and use a seed that we know fails a specific test on Windows that you can repeat. The other 2 options won't get you a 1:1 comparison.

The FSDirectory implementation sits between the OS and the many layers of index reading and writing, codecs, FSLock and other plumbing. The contract these components share is not just an API, but they require specific exceptions to be thrown (or allowed to propagate through) in order to function. So, the logs should reflect which exceptions are either arriving in the wrong place or not arriving at all to produce the checkpoint messages in the log, which should narrow down the problem.

I suspect that since AI knows our codebase it may even be able to come up with a specific cause in seconds that would take a human hours or days to analyze.

@paulirwin

Copy link
Copy Markdown
Contributor Author

@NightOwl888 That is very strange. The tests are passing reliably for me on Windows x64 and macOS arm64. Also, I'm not seeing a performance regression, despite the additional tests in this PR. In fact, it's (usually) faster:

  • PR branch
    • macOS arm64: 99.05s
    • Windows: 149.18s
  • master
    • macOS arm64: 99.96s
    • Windows x64: 154.22s

Script:

dotnet clean && dotnet build
Measure-Command { dotnet test --no-build .\src\Lucene.Net.Tests._J-S\Lucene.Net.Tests._J-S.csproj | Out-Default }

(Note: my Windows x64 desktop is a SFF PC with a laptop-grade processor that is far less powerful than my macOS laptop.)

@NightOwl888

NightOwl888 commented May 4, 2026

Copy link
Copy Markdown
Contributor

I attempted a clean and then decided to switch to net9.0 to run the tests since there are known issues with net10.0 failures in CI. But, it didn't help much. The run still took about 5 minutes and there were issues with locked files in the logs still.

So, I pushed the branch to Azure DevOps and did 3 runs there. The tests seem fine (2 failures on net10.0 which we can ignore here) and the logs are all consistently about 16MB which is what they are on other recent runs. So, the problem I am seeing is almost certainly local. I just can't figure out why the old implementation of MMapDirectory works on my machine and the new one doesn't.

@paulirwin

Copy link
Copy Markdown
Contributor Author

I'll investigate the locked files. Can you share the logs you're referring to?

Going to convert this to draft until we're sure it's stable.

@paulirwin
paulirwin marked this pull request as draft May 5, 2026 14:33
@paulirwin paulirwin mentioned this pull request May 5, 2026
1 task
@NightOwl888

Copy link
Copy Markdown
Contributor

I'll investigate the locked files. Can you share the logs you're referring to?

Going to convert this to draft until we're sure it's stable.

@paulirwin

Sorry, I don't know if you will be able to investigate this because it doesn't seem reproducible anywhere but on my machine. I am guessing because it is slow by today's standards and there is some timing issue that doesn't happen on faster machines.

I cleared some disk space, rebooted, and tried again, but this is still happening. Although, this time while there were still 4 failures, they were all TestRAMDirectory failures. This is probably something having to do with file sharing because those tests were particularly sensitive to that. Here is my latest run:

Test Log
Log level is set to Informational (Default).
Connected to test environment '< Local Windows Environment >'
Test data store opened in 0.073 sec.
========== Starting test discovery ==========
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
No suitable test runtime provider was found for any source in this run.
Skipping source: F:\Projects\lucenenet\src\Lucene.Net.TestFramework\bin\Debug\netstandard2.0\Lucene.Net.TestFramework.dll (.NETStandard,Version=v2.0, X64)

NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery complete
NUnit Adapter 4.6.0.0: Test discovery complete
NUnit Adapter 4.6.0.0: Test discovery complete
No test is available in F:\Projects\lucenenet\src\Lucene.Net.QueryParser\bin\Debug\net462\Lucene.Net.QueryParser.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
NUnit Adapter 4.6.0.0: Test discovery complete
NUnit Adapter 4.6.0.0: Test discovery complete
No test is available in F:\Projects\lucenenet\src\Lucene.Net\bin\Debug\net462\Lucene.Net.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in F:\Projects\lucenenet\src\Lucene.Net.Grouping\bin\Debug\net462\Lucene.Net.Grouping.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in F:\Projects\lucenenet\src\Lucene.Net.Join\bin\Debug\net462\Lucene.Net.Join.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in F:\Projects\lucenenet\src\Lucene.Net.Analysis.Common\bin\Debug\net462\Lucene.Net.Analysis.Common.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
NUnit Adapter 4.6.0.0: Test discovery complete
No test is available in F:\Projects\lucenenet\src\Lucene.Net.Sandbox\bin\Debug\net462\Lucene.Net.Sandbox.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
NUnit Adapter 4.6.0.0: Test discovery complete
No test is available in F:\Projects\lucenenet\src\Lucene.Net.Facet\bin\Debug\net462\Lucene.Net.Facet.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 158
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 179
System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 158
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 179
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 191
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.<>c__DisplayClass27_0.<DiscoverTestsOnConcurrentManager>b__0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 319
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 191
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.<>c__DisplayClass27_0.<DiscoverTestsOnConcurrentManager>b__0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 319
   at System.Threading.Tasks.Task.Execute()<---

NUnit Adapter 4.6.0.0: Test discovery starting
========== Test discovery aborted: 0 Tests found in 26.7 sec ==========
========== Starting test discovery ==========
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /_/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs:line 455
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 151
System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 158
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 179
System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 158
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 179
========== Test discovery aborted: 0 Tests found in 86.5 ms ==========
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
Test project Lucene.Net.TestFramework does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
Building Test Projects
Starting test discovery for requested test run
========== Starting test discovery ==========
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 191
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.<>c__DisplayClass27_0.<DiscoverTestsOnConcurrentManager>b__0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 319
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: The provided manager was not found in any slot.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.ClearCompletedSlot(TManager completedManager)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ParallelOperationManager`3.RunNextWork(TManager completedManager) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs:line 265
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscoveryManager, Int64 totalTests, IEnumerable`1 lastChunk, Boolean isAborted) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 200
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelDiscoveryEventsHandler.HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable`1 lastChunk) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs:line 75
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 191
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.Parallel.ParallelProxyDiscoveryManager.<>c__DisplayClass27_0.<DiscoverTestsOnConcurrentManager>b__0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs:line 319
   at System.Threading.Tasks.Task.Execute()<---

NUnit Adapter 4.6.0.0: Test discovery starting
NUnit Adapter 4.6.0.0: Test discovery complete
========== Test discovery finished: 1485 Tests found in 5.2 sec ==========
========== Starting test run ==========
NUnit Adapter 4.6.0.0: Test execution started
Running selected tests in F:\Projects\lucenenet\src\Lucene.Net.Tests._J-S\bin\Debug\net9.0\Lucene.Net.Tests._J-S.dll
   NUnit3TestExecutor discovered 1525 of 1525 NUnit test cases using Current Discovery mode, Non-Explicit run
TestHeartRanking:   PreFlex codec does not support the stats necessary for this test!
  Expected: True
  But was:  False

TestSimple2:   Broken scoring: LUCENE-3723
  Expected: True
  But was:  False

TestSpans2:   Broken scoring: LUCENE-3723
  Expected: True
  But was:  False

[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.Spans.TestSpans:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-1vyl53iy\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-1vyl53iy

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
TestMultithreadedWaitForGeneration: Run Manually (contains timing code that doesn't play well with other tests)
TestStraightForwardDemonstration: Run Manually (contains timing code that doesn't play well with other tests)
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestControlledRealTimeReopenThread:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fa.fdt
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fa.nvd
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fa_Lucene41_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fa_Lucene41_0.pos
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fa_Lucene41_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fa_Lucene41_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fb.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fc.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fd.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt\_fe.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\nrt-dqrxvgwt

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
TestMultiSloppyWithRepeats: This appears to be a known issue
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestShardSearching:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-tbleybda\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-tbleybda\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-tbleybda
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_4.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_5.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_6.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_7.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg\_8.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-jdq0ietg
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-r1fla1rm\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-r1fla1rm\_1.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-r1fla1rm\_2.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-r1fla1rm\_3.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-r1fla1rm\_4.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\ShardSearchingTestBase-r1fla1rm

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Search.TestSloppyPhraseQuery:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-j5qtrtub\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\index-MMapDirectory-j5qtrtub

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
Verbosity disabled. Enable manually if needed.

Verbosity disabled. Enable manually if needed.

C:\Users\shad\AppData\Local\Temp\LuceneTemp\nocreate-ayyzcumd

[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestDirectory:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-lkki3y01\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-lkki3y01\_0.cfx
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\LUCENENET521-lkki3y01

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during CleanupTemporaryFiles() in Lucene.Net.Store.TestMultiMMap:
System.IO.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-npw25fk1\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap92-npw25fk1
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap29-nhnrak4z\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap29-nhnrak4z
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap36-skhi3rt5\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap36-skhi3rt5
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap53-kzsfsc5c\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap53-kzsfsc5c
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap78-pfa4awp5\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap78-pfa4awp5
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap79-bsv1powg\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap79-bsv1powg\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap79-bsv1powg\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap79-bsv1powg
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-u5jhrrof\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-u5jhrrof\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-u5jhrrof\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap56-u5jhrrof
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap66-t1aim421\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap66-t1aim421
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap22-0xicgjnf\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap22-0xicgjnf
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap47-ahfnmvhw\_0.cfs
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap47-ahfnmvhw
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap99-v33uxodq\_0.doc
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap99-v33uxodq\_0.tim
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap99-v33uxodq\_0.tip
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\mmap99-v33uxodq
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\postXDispose-dm2duhsg\f
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\postXDispose-dm2duhsg
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testMultipleSlicesDistinct-eytka3u2\bytes
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testMultipleSlicesDistinct-eytka3u2
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testConcurrentClonesIntegrity-14iynvoq\bytes
   C:\Users\shad\AppData\Local\Temp\LuceneTemp\testConcurrentClonesIntegrity-14iynvoq

   at Lucene.Net.Util.TestUtil.Rm(FileSystemInfo[] locations) in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\TestUtil.cs:line 66
   at Lucene.Net.Util.LuceneTestCase.CleanupTemporaryFiles() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 3163
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1039
[ERROR] OneTimeTearDown: An exception occurred during RandomizedContext.DisposeResources() in Lucene.Net.Store.TestRAMDirectory:
NUnit.Framework.AssertionException: Directory not disposed: MockDirectoryWrapper(SimpleFSDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.Fail(String message, Object[] args)
   at NUnit.Framework.Assert.Fail(String message)
   at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
--- End of stack trace from previous location ---
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 265
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050
Caller Details:
Scope: SUITE
Thread Name: .NET TP Worker
Stack Trace:   at Lucene.Net.Util.LuceneTestCase.WrapDirectory(Random random, Directory directory, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d)
   at Lucene.Net.Store.TestRAMDirectory.SetUp()
   at InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.InvokeMethod(IMethodInfo method, TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TimeoutCommand.<>c__DisplayClass5_0.<RunTestOnSeparateThread>b__0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()


TearDown failed for test fixture Lucene.Net.Store.TestRAMDirectory
Directory not disposed: MockDirectoryWrapper(SimpleFSDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
TearDown : NUnit.Framework.AssertionException : Directory not disposed: MockDirectoryWrapper(SimpleFSDirectory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex lockFactory=NativeFSLockFactory@C:\Users\shad\AppData\Local\Temp\RAMDirIndex)
Data:
  _RandomizedContext_Scope: SUITE
  _RandomizedContext_ThreadName: .NET TP Worker
  _RandomizedContext_StackTrace:    at Lucene.Net.Util.LuceneTestCase.WrapDirectory(Random random, Directory directory, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf, Boolean bare)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d, LockFactory lf)
   at Lucene.Net.Util.LuceneTestCase.NewFSDirectory(DirectoryInfo d)
   at Lucene.Net.Store.TestRAMDirectory.SetUp()
   at InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.InvokeMethod(IMethodInfo method, TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
   at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUp(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.SetUpTearDownCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TimeoutCommand.<>c__DisplayClass5_0.<RunTestOnSeparateThread>b__0()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

  Lucene_SuppressedExceptions: []
StackTrace:    at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050

--TearDown
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.Fail(String message, Object[] args)
   at NUnit.Framework.Assert.Fail(String message)
   at Lucene.Net.Util.DisposableDirectory.Dispose() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\CloseableDirectory.cs:line 50
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 243
--- End of stack trace from previous location ---
   at Lucene.Net.Util.RandomizedContext.DisposeResources() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Support\Util\RandomizedContext.cs:line 265
   at Lucene.Net.Util.LuceneTestCase.OneTimeTearDown() in F:\Projects\lucenenet\src\Lucene.Net.TestFramework\Util\LuceneTestCase.cs:line 1050
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
TestThreadInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.
TestTwoThreadsInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.
TestLockInterruptibly1: LUCENENET: LockInterruptibly() is broken, but it is not in use anywhere but in the tests. Technically, Lucene.NET does not support Thread.Interrupt().
TestToString: LUCENENET: Not implemented
TestEquals: ConcurrentHashSet does not currently implement structural Equals
NUnit Adapter 4.6.0.0: Test execution complete
========== Test run finished: 1525 Tests (1504 Passed, 4 Failed, 8 Skipped) run in 4.7 min ==========

NOTE: The test runner has been throwing exceptions pretty much every time I do a discovery, but it doesn't seem to affect the testing beyond that, so I have not yet looked into fixing it.

Test Failures
 TestIllegalEOF
   Source: TestRAMDirectory.cs line 190
   Duration: 97 ms

  Message: 
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
--TearDown
FileSystem.DeleteFile(String fullPath)
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
 TestRAMDirectoryMem
   Source: TestRAMDirectory.cs line 80
   Duration: 44 ms

  Message: 
System.IO.IOException : Cannot overwrite: C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
FSDirectory.EnsureCanWrite(String name) line 385
FSDirectory.CreateOutput(String name, IOContext context) line 358
MockDirectoryWrapper.CreateOutput(String name, IOContext context) line 716
TrackingDirectoryWrapper.CreateOutput(String name, IOContext context) line 46
CompoundFileWriter.GetOutput() line 112
CompoundFileWriter.CreateOutput(String name, IOContext context) line 274
CompoundFileDirectory.CreateOutput(String name, IOContext context) line 411
Directory.Copy(Directory to, String src, String dest, IOContext context) line 202
--- End of stack trace from previous location ---
Directory.Copy(Directory to, String src, String dest, IOContext context) line 215
Directory.Copy(Directory to, String src, String dest, IOContext context) line 196
MockDirectoryWrapper.Copy(Directory to, String src, String dest, IOContext context) line 1361
TrackingDirectoryWrapper.Copy(Directory to, String src, String dest, IOContext context) line 52
IndexWriter.CreateCompoundFile(InfoStream infoStream, Directory directory, CheckAbort checkAbort, SegmentInfo info, IOContext context) line 6292
DocumentsWriterPerThread.SealFlushedSegment(FlushedSegment flushedSegment) line 618
DocumentsWriterPerThread.Flush() line 580
DocumentsWriter.DoFlush(DocumentsWriterPerThread flushingDWPT) line 650
DocumentsWriter.FlushAllThreads(IndexWriter indexWriter) line 797
IndexWriter.DoFlush(Boolean applyAllDeletes) line 4266
IndexWriter.Flush(Boolean triggerMerge, Boolean applyAllDeletes) line 4234
IndexWriter.CloseInternal(Boolean waitForMerges, Boolean doFlush) line 1293
IndexWriter.Dispose(Boolean disposing, Boolean waitForMerges) line 1184
IndexWriter.Dispose() line 1097
TestRAMDirectory.SetUp() line 75
InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--TearDown
FileSystem.DeleteFile(String fullPath)
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
InvokeStub_TestRAMDirectory.TearDown(Object, Object, IntPtr*)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
 TestRAMDirectorySize
   Source: TestRAMDirectory.cs line 113
   Duration: 1.6 sec

  Message: 
Lucene.Net.Store.LockObtainFailedException : Lock obtain timed out: Lucene.Net.Store.MockLockFactoryWrapper+MockLock
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
Lock.Obtain(Int64 lockWaitTimeout) line 138
IndexWriter.ctor(Directory d, IndexWriterConfig conf) line 871
TestRAMDirectory.SetUp() line 65
InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--TearDown
FileSystem.DeleteFile(String fullPath)
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
InvokeStub_TestRAMDirectory.TearDown(Object, Object, IntPtr*)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
 TestSeekToEOFThenBack
   Source: TestRAMDirectory.cs line 243
   Duration: 1.6 sec

  Message: 
Lucene.Net.Store.LockObtainFailedException : Lock obtain timed out: Lucene.Net.Store.MockLockFactoryWrapper+MockLock
TearDown : System.UnauthorizedAccessException : Access to the path 'C:\Users\shad\AppData\Local\Temp\RAMDirIndex\_0.cfs' is denied.

  Stack Trace: 
Lock.Obtain(Int64 lockWaitTimeout) line 138
IndexWriter.ctor(Directory d, IndexWriterConfig conf) line 871
TestRAMDirectory.SetUp() line 65
InvokeStub_TestRAMDirectory.SetUp(Object, Object, IntPtr*)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--TearDown
FileSystem.DeleteFile(String fullPath)
FileInfo.Delete()
TestRAMDirectory.RmDir(DirectoryInfo dir) line 211
TestRAMDirectory.TearDown() line 183
InvokeStub_TestRAMDirectory.TearDown(Object, Object, IntPtr*)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

But when I ran it on Azure DevOps (x64, Windows), none of the file locking problems happened.

Test Log
NUnit Adapter 4.6.0.0: Test execution started&#xD;
Running all tests in D:\a\1\s\net9.0\Lucene.Net.Tests._J-S\Lucene.Net.Tests._J-S.dll&#xD;
   NUnit3TestExecutor discovered 1525 of 1525 NUnit test cases using Current Discovery mode, Non-Explicit run&#xD;
TestSimple2:   Broken scoring: LUCENE-3723&#xD;
  Expected: True&#xD;
  But was:  False&#xD;
&#xD;
TestSpans2:   Broken scoring: LUCENE-3723&#xD;
  Expected: True&#xD;
  But was:  False&#xD;
&#xD;
TestMultithreadedWaitForGeneration: Run Manually (contains timing code that doesn't play well with other tests)&#xD;
TestStraightForwardDemonstration: Run Manually (contains timing code that doesn't play well with other tests)&#xD;
Test 'TestMultithreadedWaitForGeneration' was skipped in the test run.&#xD;
Test 'TestStraightForwardDemonstration' was skipped in the test run.&#xD;
TestDocValuesIntegration:   3.x does not support docvalues&#xD;
  Expected: True&#xD;
  But was:  False&#xD;
&#xD;
TestMultiSloppyWithRepeats: This appears to be a known issue&#xD;
Test 'TestMultiSloppyWithRepeats' was skipped in the test run.&#xD;
Verbosity disabled. Enable manually if needed.&#xD;
&#xD;
Verbosity disabled. Enable manually if needed.&#xD;
&#xD;
C:\Users\VssAdministrator\AppData\Local\Temp\LuceneTemp\nocreate-ufmyca5q&#xD;
&#xD;
TestThreadInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.&#xD;
TestTwoThreadsInterrupt: Lucene.NET does not support Thread.Interrupt(). See https://github.com/apache/lucenenet/issues/526.&#xD;
TestLockInterruptibly1: LUCENENET: LockInterruptibly() is broken, but it is not in use anywhere but in the tests. Technically, Lucene.NET does not support Thread.Interrupt().&#xD;
Test 'TestThreadInterrupt' was skipped in the test run.&#xD;
Test 'TestTwoThreadsInterrupt' was skipped in the test run.&#xD;
Test 'TestLockInterruptibly1' was skipped in the test run.&#xD;
TestToString: LUCENENET: Not implemented&#xD;
Test 'TestToString' was skipped in the test run.&#xD;
TestEquals: ConcurrentHashSet does not currently implement structural Equals&#xD;
Test 'TestEquals' was skipped in the test run.&#xD;
NUnit Adapter 4.6.0.0: Test execution complete&#xD;

I will attempt running it again in a VM on my newer machine tomorrow to see whether it is reproducible there. And I will review the exception handling to see if there are any notable differences. The UnauthorizedAccessException is usually supposed to be caught by the IsIOException() catch block because the java.nio.file.AccessDeniedException subclasses IOException.

@NightOwl888

Copy link
Copy Markdown
Contributor

@paulirwin

I found a big clue. I commented the other FSDirectory options out in LuceneTestCase so it will only ever return MMapDirectory. Then I added this class:

    public class TrackingFileStream : FileStream
    {
        internal static readonly AtomicInt32 openFileStreamCount = new AtomicInt32();
        public TrackingFileStream(string path, FileMode mode, FileAccess access, FileShare share)
            : base(path, mode, access, share)
        {
            openFileStreamCount.IncrementAndGet();
        }

        public TrackingFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options)
            : base(path, mode, access, share, bufferSize, options)
        {
            openFileStreamCount.IncrementAndGet();
        }

        protected override void Dispose(bool disposing)
        {
            openFileStreamCount.DecrementAndGet();
            base.Dispose(disposing);
        }
    }

And changed the one line in MMapDirectory where FileStream instances are created:

                FileStream fs = new TrackingFileStream(file, FileMode.Open, FileAccess.Read,
                    FileShare.ReadWrite | FileShare.Delete,
                    bufferSize: 1, FileOptions.RandomAccess);

I didn't use this class anywhere else.

I then put a breakpoint in TestRamDirectory.TearDown() before it attempts to clean up the files, started debugging the TestRAMDirectoryMem() directory. When it hit the breakpoint, I checked the number of open FileStream instances. Here are the results of 2 different runs.

image

Clearly, we have a hole where FileStream instances can be created and not Dispose()d. I am still investigating where the hole is.

I did see a breakpoint hit once in the FileStream.Length == 0 path, but there was no issue with the disposal there, and no additional exceptions were thrown by FileStream.Dispose() that were ignored.

paulirwin and others added 16 commits June 16, 2026 16:14
Each OpenInput/CreateSlicer now creates a fresh SharedMapping rather
than sharing one via a per-file ConcurrentDictionary cache. Matches
upstream Java Lucene 4.8.1 (fresh FileChannel.map() per openInput) and
fixes the stale-length divergence where a second OpenInput after a
file grew on disk would observe the cached length.

Removes _mappings, AcquireMapping/ReleaseMapping, Lazy<SharedMapping>,
and SharedMapping's refcount (TryAcquire/Release). Ownership becomes
a simple ownsMapping bool passed at MMapIndexInput construction; only
root instances and slicers dispose the underlying mapping.

Adds three tests covering snapshot-at-open semantics, second-open-
after-growth, and reopen-after-cache-drained — confirmed to match
upstream Java behavior via a Maven repro against lucene-core 4.8.1.

Benchmarked against the cached design and upstream Java (BDN on .NET 10,
JMH on JDK 8): no-cache is within noise on 5/6 benchmarks; the only
measurable cost is ~250 us over 100 sequential opens of the same file
at 64 MB, a synthetic workload Lucene callers don't hit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ointers

Rewrites the inner IndexInput to derive directly from IndexInput
rather than BufferedIndexInput, and to read straight from cached raw
pointers obtained once per chunk via SafeBuffer.AcquirePointer.
ReadByte / ReadInt16 / ReadInt32 / ReadInt64 become single-bounds-
check fast paths with no managed-buffer indirection; ReadVInt32,
ReadVInt64, ReadString, etc. inherit from DataInput and call our fast
ReadByte, so they pick up the speedup automatically. This mirrors
upstream Java's ByteBufferIndexInput, which also derives directly from
IndexInput.

Per-chunk concurrency now uses a rent count + closed flag packed into
a single int. A reader holds a "rent" on the chunk for as long as it
caches that chunk's pointer (between chunk crossings, or until Seek /
Dispose). Chunk.Close flips the closed bit immediately, but the actual
ReleasePointer + accessor.Dispose is deferred until every outstanding
rent has been released. This is the lazy-unmap pattern: Close never
blocks, no SpinWait, and AccessViolationExceptions are structurally
impossible because UnmapViewOfFile / munmap can't run while any rent
is outstanding — fixing apache#1013 by construction rather than by retry.

The fast path stores a precomputed `readBase` pointer (chunkBasePtr +
baseOffset - chunkFileStart) so the hot-path load is a single
*(readBase + pos) with no extra adds. ReadBytes uses
Unsafe.CopyBlockUnaligned with a chunk-crossing loop. Cross-thread
Dispose (slicer.Dispose tearing down slices being read on other
threads — the apache#1013 scenario) clears currentEnd to 0 from any thread;
the reader's next call falls into the slow path, observes the closed
state, releases its own rent on its own thread, and throws
AlreadyClosedException.

Adds extensive unit tests in TestMultiMMap covering chunk-boundary
crossings for every read entry point (ReadByte, ReadInt16/32/64,
ReadVInt32/64, ReadBytes, Seek, SkipBytes), cross-thread Dispose
during reads, post-X-thread-dispose read paths, slicer-Dispose-while-
slices-being-read, double-dispose idempotency, sliced reads with non-
zero base offsets across chunk boundaries, EOF at exact length, and
zero-length file handling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Final pre-merge review pass. Four small changes plus matching tests:

- Drop unused Chunk.IsClosed property. Was only referenced by stale
  comments from an earlier design; no callers in source or tests.

- Use Interlocked.Exchange instead of Volatile.Write to clear
  currentEnd from the cross-thread Dispose path. Lucene.NET still
  targets net462, where 64-bit writes can tear on 32-bit x86. The
  rent keeps the mapping alive so a torn write isn't a memory-safety
  bug, but it could let a disposed reader return one extra byte
  before throwing on the next call. Interlocked.Exchange is atomic on
  every supported runtime.

- Validate offset/length in IndexInputSlicer.OpenSlice. Reject
  negative offset, negative length, and ranges that exceed the file.
  Previously a bad slice with offset+length > mapping.Length would
  read trailing zero bytes from the page-rounded mapping rather than
  failing — Java's MMapDirectory validates here too.

- MMapIndexInput.Clone() now checks instanceClosed up front and
  throws AlreadyClosedException, rather than deferring the failure to
  the first read on the clone. Matches upstream Java's fail-fast
  contract.

Tests: adds TestOpenSlice_OutOfBounds_Throws covering negative
offsets/lengths, ranges past EOF, and the legitimate edge cases (empty
slice at start, empty slice at file end, full file);
TestCloneAfterRootDispose_ThrowsAlreadyClosed locking in the new
Clone fail-fast contract; TestSliceNonZeroOffset_SeekToZero_ReadsSliceStart
exercising slice-relative Seek(0) from a slice that begins mid-chunk.
Updates TestCloneAfterDispose_ReadsThrowAlreadyClosed (the post-
dispose half) to expect Clone() itself to throw.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…1090 retry loop

MemoryMappedFile.CreateFromFile accepts capacity: 0 to mean "size the
mapping from the file's current length on disk." The framework does its
own stat as part of the mapping creation, so there is no caller-side
capacity for the file size to disagree with — the race window that
apache#1090 was about is closed at the API boundary.

This also lets us drop the FileStream we were holding alongside
SharedMapping. The only thing it was being used for was capturing
fc.Length to feed into our retry loop, plus being kept alive so the
mapping had a handle. The path-based CreateFromFile overload opens
its own handle and disposes it with the MemoryMappedFile, so we no
longer need our own.

Removes the retry loop in CreateMemoryMappedFile, the s_capacityRetryCount
and s_maxCapacityAttemptsObserved test-observability counters, and the
fileStream field on SharedMapping.

Rewrites TestOpenInputConcurrentFileExtension_Issue1090 from a "race
fired and was retried" assertion into a "OpenInput succeeds under
concurrent file extension" smoke test. With capacity: 0 the original
race no longer reaches the framework, so 8700 OpenInput iterations
over 15s observed zero retries before the change. The test now
shortens to a 5s window and simply asserts that every OpenInput
completes cleanly while another thread extends/truncates the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-while-mapped

The path-based MemoryMappedFile.CreateFromFile overload internally
opens the file with FileShare.Read. On Windows that blocks any
subsequent open-for-write or open-for-delete on the same file while
we hold the mapping. Callers like FreeTextSuggester build a temp
index, dispose the directory, and then recursively delete the
directory; on Windows that recursive delete fails with
"The process cannot access the file ... because it is being used by
another process" because Windows requires FILE_SHARE_DELETE on the
existing handle for a delete to proceed against an open file.

Switch back to opening our own FileStream so we control the share
flags. We use FileShare.ReadWrite | FileShare.Delete to match the
prior behavior (other writers/deleters can proceed; Windows will
defer the actual unlink until our last close, which is the standard
Unix-like semantic the rest of the framework expects). We still
pass capacity: 0 to CreateFromFile so the framework does its own
size stat — the apache#1090 race window stays closed. leaveOpen: false
hands the FileStream's lifetime to the MMF, so we don't have to
track it as a SharedMapping field.

Zero-length files are handled up front rather than letting
CreateViewAccessor reject the empty view: we dispose the FileStream
eagerly and return an empty SharedMapping.

Caught by Windows CI: TestFreeTextSuggester.TestBasic and siblings
failed with InvalidOperationException("failed to remove ...") wrapped
around IOException("write.lock ... being used by another process")
on net8.0 / net472 / net48 Windows runners. Linux passed because
Linux's "delete while open" semantics don't depend on the open
handle's share mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The slow path of ReadInt16/32/64 routed through base.ReadIntXX, which
called back into our ReadByte 2-8 times via virtual dispatch. Replace
with stackalloc + ReadBytes + BinaryPrimitives.ReadXxxBigEndian so the
JIT can devirtualize the inner reads.

ReadBytes(byte[]) and ReadBytes(Span<byte>) now share a private
ReadBytesCore(ref byte, int) that takes a raw ref to skip the per-call
Span ctor and per-iteration Slice/GetReference. Adds a small-copy
switch (1/2/4/8) so the int slow paths avoid CopyBlockUnaligned entry
overhead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Chunk's basePtr/length fields are internal-readonly and used outside
the type, so they were renamed to PascalCase per review. The API scan
flags any non-public field that doesn't match camelCase; add an
exception regex for these two as suggested in the review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ing cleanup

SharedMapping now owns and deterministically disposes the backing
FileStream (leaveOpen: true) instead of relying on the finalizer; the
MemoryMappedFile only borrows the handle and never disposes the stream
object. Adds internal test seams (MMapIndexInput.Mapping,
SharedMapping.IsFileStreamDisposed) and tests asserting the stream is
disposed on input/slicer dispose.

Fixes the two DisposeWhileHandlingException misuses (CreateAttempt and
MapChunks): dispose via the swallowing overload then rethrow with a bare
throw, so the original stack trace is preserved and there is no
double-throw. Removes the dead catch/dispose guards in OpenInput and
CreateSlicer (the constructors only set fields and cannot throw there)
and documents the mapping-ownership and slice-lifetime contracts.
Corrects the test comment that implied AlreadyClosedException is a
distinct type from ObjectDisposedException.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wraps a real MMapDirectory in MockDirectoryWrapper and exercises the
root input, slicer, and slice disposal paths. On dispose the wrapper
throws "cannot close: there are still open files" if any directly-opened
input/slicer/slice was not disposed, so this gates the MMap-specific
disposal paths end to end (TestRandomChunkSizes already covers the
OpenInput-via-IndexWriter path). Documents that clones are not tracked
by upstream MockDirectoryWrapper and that this gate is at the IndexInput
level, distinct from the FileStream-disposal seam test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ache#1013)

Fixes a permanent leak of a MemoryMappedViewAccessor (and its mapped
address space) when an MMapIndexInput is disposed on a different thread
than the one holding its cached chunk rent, e.g. IndexInputSlicer.Dispose
tearing down slices that other threads are still reading (the apache#1013
scenario). NightOwl888 reproduced this on PR apache#1267 as a non-zero
undisposed-accessor openCount after a postings-format test run.

Root cause: the cross-thread Dispose path correctly skips releasing the
reader's rent (releasing it there could unmap the view under a live read,
an AVE). But if that reader then stops reading without disposing on its
own thread, the rent is never released, so the chunk's inFlight count
stays >= 1, Chunk.ReleaseNative never runs, Chunk.accessor is never nulled
and stays reachable via SharedMapping.Chunks[], so the accessor is never
finalized and the view is never unmapped, for the process lifetime.

Fix: on the cross-thread Dispose path, hand the stranded rent off to a
finalizable StrandedRentReleaser whose finalizer calls Chunk.Release()
exactly once. The releaser is a separate object (not a finalizer on
MMapIndexInput, which the base IndexInput.Dispose() would un-arm via its
unconditional GC.SuppressFinalize) referenced from the input, so its
finalizer runs only once the input is unreachable, at which point no
thread can be mid-read through it, making the Release (and any resulting
unmap) AVE-safe. The same-thread Dispose path is unchanged and stays
allocation- and finalizer-free; the hot read path is untouched.

ReleaseCurrentChunk and HandOffStrandedRent both swap currentChunk via
Interlocked.Exchange so a rent is released at most once.

Adds TestStrandedChunkRentReclaimedByFinalizer (a TDD regression test that
fails without the handoff and passes with it) plus two internal test-only
Chunk seams (IsNativeReleased, IsNativeReleasedOrZeroRent). Verified
against the nightly cross-thread/slicer stress tests (no AVE).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@NightOwl888

Copy link
Copy Markdown
Contributor

@NightOwl888 GitHub hadn't reloaded your comments in the browser when I last commented about ADO tests; sorry about that, didn't mean to talk past you. I didn't see them until I checked my email.

I don't currently comprehend how these tests are so stable for me on macOS, Windows 11, GitHub (Ubuntu + Windows), and ADO (Ubuntu/Windows/macOS) across many runs, but you're regularly getting failures. It's difficult for me to try to fix something that I can't reproduce. Is it possible there's something different about how it's running on your machine? I've also reviewed this code many times over and I am not seeing leak potential (not to mention I've "fixed" it several different ways in this PR already).

In the meantime, I'll keep exploring and trying to reproduce...

I guess that explains why you keep asking for repros even though I have been posting all of the failure messages and logs!

Frankly, since it is clear we cannot rely on the tests to reproduce, I suggest we add debug-only tests that inject adapters for types that must be disposed (or similar changes) and add simple call counters for each of those. Dispose() should always be called an equal (ideally) or more times than the constructor. Also, add some debug logging. All we really need is proof that the file handles are remaining open and there is plenty of evidence of that.

I was able to give each MMapIndexInput a unique id and log both that id and the managed thread id that there seems to be at least 2 threads calling some instances of MMapIndexInput. I suspected that there was a race in EnsureCurrentChunk() because it appears that the local cache values:

        private Chunk? currentChunk;
        private byte* readBase;        // = chunkBasePtr + baseOffset - chunkFileStart
        private long currentStart;     // slice-relative start of the cached chunk's intersection with [0, length)
        private long currentEnd;       // slice-relative end of the cached chunk's intersection with [0, length)
        // ManagedThreadId of the thread that acquired currentChunk's rent.
        // Used to keep cross-thread Dispose (e.g., slicer.Dispose disposing
        // slices being read on other threads) from releasing a rent it
        // doesn't own — see Dispose for the lifecycle rationale.
        private int currentChunkOwnerThreadId;

are not thread safe. I had a theory that a race between callers was causing currentChunk to be null when it shouldn't be, but after placing lock statements in EnsureCurrentChunk(), ReleaseCurrentChunk() and Dispose(bool), that seemed not to be the case. Still, it seems like this cached data should be async local since multiple threads are reaching this class.

I also noticed that Close() can be made to close all of the file handles by commenting this line:

            /// <summary>
            /// Mark the chunk closed. New <see cref="TryAcquire"/> calls fail.
            /// If no rents are outstanding, releases native resources
            /// immediately; otherwise the last <see cref="Release"/> will.
            /// </summary>
            public void Close()
            {
                // CAS-loop: set the closed bit if not already set.
                while (true)
                {
                    int s = Volatile.Read(ref state);
                    if ((s & CLOSED_BIT) != 0) return; // already closed
                    int next = s | CLOSED_BIT;
                    if (Interlocked.CompareExchange(ref state, next, s) == s)
                    {
                        //if (next == CLOSED_BIT) // This double-gate is preventing dispose sometimes
                        {
                            // No rents outstanding; we own the unmap.
                            ReleaseNative();
                        }
                        return;
                    }
                }

That brought the dispose count back to 0 on the MemoryMappedViewAccessorWrapper. This is clearly not a fix, but it is a big clue that something about the bookkeeping is broken.

@NightOwl888

Copy link
Copy Markdown
Contributor

BTW - I forgot to mention that although the above CLOSED_BIT hack significantly reduced the number of files left on disk, it still happened in some cases. So, there is at least one more place where a file handle is being kept open.

@paulirwin
paulirwin marked this pull request as draft June 17, 2026 14:12
@paulirwin

Copy link
Copy Markdown
Contributor Author

I guess that explains why you keep asking for repros even though I have been posting all of the failure messages and logs!

Not quite, I was only referring to the messages right before that comment 😄

Okay this PR has taken quite a lot of twists and turns, and there are many comments here that make it hard to scroll through to get to the end. I'm going to close this PR and re-open it fresh, without all of the baggage of this discussion history.

The updated PR includes a fix that should resolve any remaining issues, as well as simplify the implementation, but we can discuss that over there when I open it.

@paulirwin paulirwin closed this Jun 17, 2026
paulirwin added a commit to paulirwin/lucene.net that referenced this pull request Jun 17, 2026
…ing cleanup

SharedMapping now owns and deterministically disposes the backing
FileStream (leaveOpen: true) instead of relying on the finalizer; the
MemoryMappedFile only borrows the handle and never disposes the stream
object. Adds internal test seams (MMapIndexInput.Mapping,
SharedMapping.IsFileStreamDisposed) and tests asserting the stream is
disposed on input/slicer dispose.

Fixes the two DisposeWhileHandlingException misuses (CreateAttempt and
MapChunks): dispose via the swallowing overload then rethrow with a bare
throw, so the original stack trace is preserved and there is no
double-throw. Removes the dead catch/dispose guards in OpenInput and
CreateSlicer (the constructors only set fields and cannot throw there)
and documents the mapping-ownership and slice-lifetime contracts.
Corrects the test comment that implied AlreadyClosedException is a
distinct type from ObjectDisposedException.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
paulirwin added a commit to paulirwin/lucene.net that referenced this pull request Jun 17, 2026
…ache#1013)

Fixes a permanent leak of a MemoryMappedViewAccessor (and its mapped
address space) when an MMapIndexInput is disposed on a different thread
than the one holding its cached chunk rent, e.g. IndexInputSlicer.Dispose
tearing down slices that other threads are still reading (the apache#1013
scenario). NightOwl888 reproduced this on PR apache#1267 as a non-zero
undisposed-accessor openCount after a postings-format test run.

Root cause: the cross-thread Dispose path correctly skips releasing the
reader's rent (releasing it there could unmap the view under a live read,
an AVE). But if that reader then stops reading without disposing on its
own thread, the rent is never released, so the chunk's inFlight count
stays >= 1, Chunk.ReleaseNative never runs, Chunk.accessor is never nulled
and stays reachable via SharedMapping.Chunks[], so the accessor is never
finalized and the view is never unmapped, for the process lifetime.

Fix: on the cross-thread Dispose path, hand the stranded rent off to a
finalizable StrandedRentReleaser whose finalizer calls Chunk.Release()
exactly once. The releaser is a separate object (not a finalizer on
MMapIndexInput, which the base IndexInput.Dispose() would un-arm via its
unconditional GC.SuppressFinalize) referenced from the input, so its
finalizer runs only once the input is unreachable, at which point no
thread can be mid-read through it, making the Release (and any resulting
unmap) AVE-safe. The same-thread Dispose path is unchanged and stays
allocation- and finalizer-free; the hot read path is untouched.

ReleaseCurrentChunk and HandOffStrandedRent both swap currentChunk via
Interlocked.Exchange so a rent is released at most once.

Adds TestStrandedChunkRentReclaimedByFinalizer (a TDD regression test that
fails without the handoff and passes with it) plus two internal test-only
Chunk seams (IsNativeReleased, IsNativeReleasedOrZeroRent). Verified
against the nightly cross-thread/slicer stress tests (no AVE).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
paulirwin added a commit to paulirwin/lucene.net that referenced this pull request Jun 17, 2026
Replace the hand-rolled per-chunk "rent" state machine (packed
state/CLOSED_BIT/RENT_INC, TryAcquire/Release/Close/ReleaseNative CAS
loops) with the BCL's own SafeMemoryMappedViewHandle refcount: a
per-chunk-crossing AcquirePointer/ReleasePointer is the drain barrier,
and accessor.Dispose() defers the actual unmap until all references
drain and fails a later crossing fast (ObjectDisposedException ->
AlreadyClosedException). This is the .NET-native equivalent of the
custom rent, correct by construction, and apache#1151-safe because the
reference is taken once per chunk crossing, not per read (a per-read
refcount touch is the ~218x concurrency cliff apache#1151 is about).

The cross-thread Dispose deferral is still required: a disposer must not
release a read reference the acquiring reader may be mid-dereference of,
or Chunk.Close could unmap the view under it (AVE). A same-thread
Dispose releases directly; a cross-thread Dispose hands the reference to
a finalizable StrandedReadRefReleaser that releases it once the input is
unreachable. This is proven necessary by
TestConcurrentSliceReadVsSlicerDispose, which AVEs without it.

Tests: replace the finalizer-reclamation test with deterministic
cross-thread-dispose and clone-dispose leak tests that assert chunk
views and the backing FileStream are released synchronously (no
GC.Collect/WaitForPendingFinalizers). The clone-dispose test closes the
gap NightOwl888 hit (apache#1267): MockDirectoryWrapper's open-files gate does
not track clones, so a clone leaking its view on its own Dispose would
not fail that gate but would keep the file mapped (blocking overwrite/
delete on Windows). All 4 nightly concurrent race tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
marionoack pushed a commit to RoesbergEngineering/lucenenet that referenced this pull request Jul 23, 2026
…ing cleanup

SharedMapping now owns and deterministically disposes the backing
FileStream (leaveOpen: true) instead of relying on the finalizer; the
MemoryMappedFile only borrows the handle and never disposes the stream
object. Adds internal test seams (MMapIndexInput.Mapping,
SharedMapping.IsFileStreamDisposed) and tests asserting the stream is
disposed on input/slicer dispose.

Fixes the two DisposeWhileHandlingException misuses (CreateAttempt and
MapChunks): dispose via the swallowing overload then rethrow with a bare
throw, so the original stack trace is preserved and there is no
double-throw. Removes the dead catch/dispose guards in OpenInput and
CreateSlicer (the constructors only set fields and cannot throw there)
and documents the mapping-ownership and slice-lifetime contracts.
Corrects the test comment that implied AlreadyClosedException is a
distinct type from ObjectDisposedException.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
marionoack pushed a commit to RoesbergEngineering/lucenenet that referenced this pull request Jul 23, 2026
…ache#1013)

Fixes a permanent leak of a MemoryMappedViewAccessor (and its mapped
address space) when an MMapIndexInput is disposed on a different thread
than the one holding its cached chunk rent, e.g. IndexInputSlicer.Dispose
tearing down slices that other threads are still reading (the apache#1013
scenario). NightOwl888 reproduced this on PR apache#1267 as a non-zero
undisposed-accessor openCount after a postings-format test run.

Root cause: the cross-thread Dispose path correctly skips releasing the
reader's rent (releasing it there could unmap the view under a live read,
an AVE). But if that reader then stops reading without disposing on its
own thread, the rent is never released, so the chunk's inFlight count
stays >= 1, Chunk.ReleaseNative never runs, Chunk.accessor is never nulled
and stays reachable via SharedMapping.Chunks[], so the accessor is never
finalized and the view is never unmapped, for the process lifetime.

Fix: on the cross-thread Dispose path, hand the stranded rent off to a
finalizable StrandedRentReleaser whose finalizer calls Chunk.Release()
exactly once. The releaser is a separate object (not a finalizer on
MMapIndexInput, which the base IndexInput.Dispose() would un-arm via its
unconditional GC.SuppressFinalize) referenced from the input, so its
finalizer runs only once the input is unreachable, at which point no
thread can be mid-read through it, making the Release (and any resulting
unmap) AVE-safe. The same-thread Dispose path is unchanged and stays
allocation- and finalizer-free; the hot read path is untouched.

ReleaseCurrentChunk and HandOffStrandedRent both swap currentChunk via
Interlocked.Exchange so a rent is released at most once.

Adds TestStrandedChunkRentReclaimedByFinalizer (a TDD regression test that
fails without the handoff and passes with it) plus two internal test-only
Chunk seams (IsNativeReleased, IsNativeReleasedOrZeroRent). Verified
against the nightly cross-thread/slicer stress tests (no AVE).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
marionoack pushed a commit to RoesbergEngineering/lucenenet that referenced this pull request Jul 23, 2026
Replace the hand-rolled per-chunk "rent" state machine (packed
state/CLOSED_BIT/RENT_INC, TryAcquire/Release/Close/ReleaseNative CAS
loops) with the BCL's own SafeMemoryMappedViewHandle refcount: a
per-chunk-crossing AcquirePointer/ReleasePointer is the drain barrier,
and accessor.Dispose() defers the actual unmap until all references
drain and fails a later crossing fast (ObjectDisposedException ->
AlreadyClosedException). This is the .NET-native equivalent of the
custom rent, correct by construction, and apache#1151-safe because the
reference is taken once per chunk crossing, not per read (a per-read
refcount touch is the ~218x concurrency cliff apache#1151 is about).

The cross-thread Dispose deferral is still required: a disposer must not
release a read reference the acquiring reader may be mid-dereference of,
or Chunk.Close could unmap the view under it (AVE). A same-thread
Dispose releases directly; a cross-thread Dispose hands the reference to
a finalizable StrandedReadRefReleaser that releases it once the input is
unreachable. This is proven necessary by
TestConcurrentSliceReadVsSlicerDispose, which AVEs without it.

Tests: replace the finalizer-reclamation test with deterministic
cross-thread-dispose and clone-dispose leak tests that assert chunk
views and the backing FileStream are released synchronously (no
GC.Collect/WaitForPendingFinalizers). The clone-dispose test closes the
gap NightOwl888 hit (apache#1267): MockDirectoryWrapper's open-files gate does
not track clones, so a clone leaking its view on its own Dispose would
not fail that gate but would keep the file mapped (blocking overwrite/
delete on Windows). All 4 nightly concurrent race tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:breaking-change Has changes that will break backward compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search performance issue with MMapDirectory under load Search crash

3 participants