Skip to content

TdsParserStateObject.ResetSnapshot() Debug.Assert failing #3385

@paulmedynski

Description

@paulmedynski

Failure is here:

    /home/paul/dev/SqlClient/dev/paul/app-context-switch-test-helper/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs(3441): error TESTERROR:
      Microsoft.Data.SqlClient.ManualTesting.Tests.DataReaderTest.CanReadXmlData (354ms): Error Message: Microsoft.VisualSt
      udio.TestPlatform.TestHost.DebugAssertException : Method Debug.Fail failed with 'snapshot._storage == null
      ', and was translated to Microsoft.VisualStudio.TestPlatform.TestHost.DebugAssertException to avoid terminating the p
      rocess hosting the test.

Here's the code:

            if (_snapshot != null)
            {
                StateSnapshot snapshot = _snapshot;
                _snapshot = null;
                Debug.Assert(snapshot._storage == null);
                snapshot.Clear();
                Interlocked.CompareExchange(ref _cachedSnapshot, snapshot, null);
            }

@Wraith2 I'm not sure what the intention of the Assert() is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area\TestsIssues that are targeted to tests or test projects

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions