Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser] TCFullEndElement unit test - give GC more chance #111871

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,35 @@
using System.Text;
using OLEDB.Test.ModuleCore;
using XmlCoreTest.Common;
using System.Threading;
using System.Threading.Tasks;
using Xunit;

namespace System.Xml.XmlWriterApiTests
{
//[TestCase(Name = "WriteFullEndElement")]
public class TCFullEndElement
public class TCFullEndElement : IAsyncLifetime
{
public async Task InitializeAsync()
{
// when running in browser, we only have 32bit address space
// and this unit test is allocating a lot of resources. Which often leads to OOM in CI
// yielding to the browser event loop will give the runtime ability to run finalizers
if (OperatingSystem.IsBrowser())
{
await Task.Yield();
}
}

public Task DisposeAsync()
{
if (OperatingSystem.IsBrowser())
{
GC.Collect();
}
return Task.CompletedTask;
}

// Sanity test for WriteFullEndElement()
[Theory]
[XmlWriterInlineData]
Expand Down
Loading