Skip to content

Conversation

@StephenMolloy
Copy link
Member

Fixes #74370

These new tests use a few simple collections of schemas grouped in XmlSchemaSet. They were ported from NetFx, where apparently the test environment ran each test one at a time. (Seems that is also the case "on my machine" and in whatever pipelines were run to allow the tests to get checked in.) But XmlSchemaSet is not thread safe, so parallel execution of tests using a static XmlSchemaSet could be problematic. This change builds a new XmlSchemaSet per test instead of re-using a single instance.

@ghost ghost added the area-Serialization label Aug 24, 2022
@ghost ghost assigned StephenMolloy Aug 24, 2022
@StephenMolloy StephenMolloy added this to the 7.0.0 milestone Aug 24, 2022
internal static XmlSchemaSet PositiveSchemas = SchemaUtils.ReadStringsIntoSchemaSet(
new string[] {
private static string[] _positiveSchemas = new string[] {
@"<?xml version='1.0' encoding='utf-8'?><schema elementFormDefault='qualified' targetNamespace='http://schemas.datacontract.org/2004/07/fooNs' xmlns:tns='http://schemas.datacontract.org/2004/07/fooNs' xmlns:ser='http://schemas.microsoft.com/2003/10/Serialization/' xmlns='http://www.w3.org/2001/XMLSchema'>
Copy link
Member

Choose a reason for hiding this comment

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

Nit: naming. Statics should start with s_. Other than that, LGTM

@karelz karelz modified the milestones: 7.0.0, 8.0.0 Aug 25, 2022
@karelz
Copy link
Member

karelz commented Aug 25, 2022

FYI: This PR is against main, so in 8.0. To get the bug fixed in 7.0, there will need to be backport. It should not affect milestone of this specific PR.

@StephenMolloy StephenMolloy merged commit 7b0227d into dotnet:main Aug 25, 2022
@StephenMolloy
Copy link
Member Author

@karelz - which 7.0 branch(es) do you need this backported to?

@karelz
Copy link
Member

karelz commented Aug 25, 2022

/backport to release/7.0

@github-actions
Copy link
Contributor

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/2925595397

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Runtime.Serialization.Schema.Tests failures

3 participants