Skip to content

Fix S2342 FP: Flaky reports #9683

Open
Open
@bart-vmware

Description

Description

During ci-build, we randomly get build errors such as the following:

error S2342: Rename this enumeration to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$'

The affected [Flags] enum is named FastTestConfigurations, which complies with the rule. Because we sometimes get this error, but not always, I suspect a static regex is being used that isn't thread-safe.

[Flags]
public enum FastTestConfigurations
{
    ConfigServer = 1,
    Discovery = 2,
    Connectors = 4,
    WaveFrontExport = 8,
    All = ConfigServer | Discovery | Connectors | WaveFrontExport
}

Repro steps

Not available, it happens randomly, but not always. I've seen this multiple times in Azure DevOps, running on Ubuntu against .NET 8. I haven't experienced it locally on Windows 11.

Known workarounds

Restart the cibuild, which usually makes the error go away.

Related information

  • C#/VB.NET Plugins version: 9.25.1.91650
  • Visual Studio version: 17.11.5
  • MSBuild / dotnet version: .NET 8
  • SonarScanner for .NET version (if used): N/A
  • Operating System: Ubuntu

Metadata

Labels

Area: C#C# rules related issues.Area: VB.NETVB.NET rules related issues.Type: False PositiveRule IS triggered when it shouldn't be.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions