apache / apache/lucenenet

Investigate `TestDirectoryTaxonomy.TestConcurrency()` rare test failure

Open
#1,444 0 comments 0 reactions 0 assignees View on GitHub
is:bug
Dominant language
C#
Stars
2.4k
Forks
658
Avg merge
3d 5h
Merged PRs (30d)
9

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

This test failed 1 out of 30 runs when merging `master` @ e7e18b275abafbb9c010a32b844f0c04592a4fac+ #1373 + #1311.

```
mismatch number of categories
(Test: Lucene.Net.Facet.Taxonomy.Directory.TestDirectoryTaxonomyWriter.TestConcurrency)

To reproduce this test result:

Option 1:

Apply the following assembly-level attributes:

[assembly: Lucene.Net.Util.RandomSeed("0x82f9bca80d16aa84:0xffeaa58b2329e4e9")]
[assembly: NUnit.Framework.SetCulture("en")]

Option 2:

Use the following .runsettings file:




Option 3:

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

{
"tests": {
"seed": "0x82f9bca80d16aa84:0xffeaa58b2329e4e9",
"culture": "en"
}
}

Fixture Test Values

Random Seed: 0x82f9bca80d16aa84:0xffeaa58b2329e4e9
Culture: en
Time Zone: (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Default Codec: Lucene41 (Lucene41RWCodec)
Default Similarity: RandomSimilarityProvider(queryNorm=True,coord=yes): {}

System Properties

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

Stack trace
at Lucene.Net.Facet.Taxonomy.Directory.TestDirectoryTaxonomyWriter.TestConcurrency() in /_/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs:line 325

1) at Lucene.Net.Facet.Taxonomy.Directory.TestDirectoryTaxonomyWriter.TestConcurrency() in /_/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs:line 325

```

I was unable to reproduce it more than the one time, so I am opening this issue to track it in case it happens again after those 2 PRs are merged. I attempted to reproduce it on all 3 upstream branches without success (even when I placed `[Repeat(25)]` on it).

Since the combination of those 3 branches is much more stable than any of them on their own, it seems like merging them should take priority over tracking this issue down.

### Expected Behavior

_No response_

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### Lucene.NET Version

master @ e7e18b275abafbb9c010a32b844f0c04592a4fac+ #1373 + #1311

### .NET Version

net8.0

### Operating System

Windows

### Anything else?

x86

Contributor guide

Open the contributing guide

Research direction

Start with src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs, especially TestConcurrency() around line 325. Run the test with the supplied seed and culture settings, then investigate the intermittent category-count mismatch. Done means identifying the cause and adding a reliable fix or regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.