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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions changelog.d/unreleased/2943.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 2943
affected:
- src/CodeIndex/Indexer/BoundedRegex.cs
- src/CodeIndex/Cli/RuntimeSafety.cs
---

## English

- **SQL reference JSON tests no longer drop references under grouped net9 runs (#2943)** - bounded SQL extraction regexes now share the runtime safety timeout budget, preventing grouped net9 validation from treating transient regex timeouts as missing SQL target/source references.

## 日本語

- **grouped net9 実行で SQL reference JSON テストが参照を落とさなくなりました (#2943)** - SQL 抽出用の bounded regex が runtime safety の timeout 予算を共有するようになり、grouped net9 検証で一時的な regex timeout が SQL target/source 参照欠落として扱われる問題を防ぎます。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/2945.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: fixed
issues:
- 2945
affected:
- src/CodeIndex/Indexer/BoundedRegex.cs
- src/CodeIndex/Cli/RuntimeSafety.cs
- tests/CodeIndex.Tests/BoundedRegexTests.cs
---

## English

- **Reference extraction keeps the runtime safety regex budget under full-suite load (#2945)** - bounded extractor regexes now use the same 2-second match timeout that the CLI reports for regex safety, avoiding false-negative reference extraction when local full test runs are CPU-contended.

## 日本語

- **full suite の高負荷時も参照抽出が runtime safety の regex 予算を使うようになりました (#2945)** - bounded extractor regex は CLI が regex safety として報告する 2 秒の match timeout と同じ値を使うようになり、CPU 競合下のローカル full test で参照抽出が false negative になる問題を避けます。
3 changes: 2 additions & 1 deletion src/CodeIndex/Cli/RuntimeSafety.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Text.RegularExpressions;
using CodeIndex.Indexer;

namespace CodeIndex.Cli;

internal static class RuntimeSafety
{
internal static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(2);
internal static readonly TimeSpan RegexMatchTimeout = BoundedRegex.DefaultMatchTimeout;

public static void Configure()
{
Expand Down
2 changes: 1 addition & 1 deletion src/CodeIndex/Indexer/BoundedRegex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CodeIndex.Indexer;
internal sealed class BoundedRegex : BclRegex
{
// Keep regex matches bounded, but leave enough scheduler headroom for full-suite CI contention.
internal static readonly TimeSpan DefaultMatchTimeout = TimeSpan.FromSeconds(1);
internal static readonly TimeSpan DefaultMatchTimeout = TimeSpan.FromSeconds(2);

public BoundedRegex(string pattern)
: base(pattern, RegexOptions.None, DefaultMatchTimeout)
Expand Down
7 changes: 7 additions & 0 deletions tests/CodeIndex.Tests/BoundedRegexTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using CodeIndex.Cli;
using CodeIndex.Indexer;

namespace CodeIndex.Tests;
Expand All @@ -12,4 +13,10 @@ public void DefaultMatchTimeout_KeepsBoundedMatchesFromTimingOutUnderNormalSched
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(5));
}

[Fact]
public void DefaultMatchTimeout_MatchesRuntimeSafetyTimeout()
{
Assert.Equal(RuntimeSafety.RegexMatchTimeout, BoundedRegex.DefaultMatchTimeout);
}
}
Loading