<commit_before>// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Testing;
using Xunit;

namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
{
    [Collection(IISTestSiteCollection.Name)]
    public class SynchronousReadAndWriteTests: FixtureLoggedTest
    {
        private readonly IISTestSiteFixture _fixture;

        public SynchronousReadAndWriteTests(IISTestSiteFixture fixture): base(fixture)
        {
            _fixture = fixture;
        }

        [ConditionalFact]
        [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/7341")]
        public async Task ReadAndWriteSynchronously()
        {
            for (int i = 0; i < 100; i++)
            {
                var content = new StringContent(new string('a', 100000));
                var response = await _fixture.Client.PostAsync("ReadAndWriteSynchronously", content);
                var responseText = await response.Content.ReadAsStringAsync();

                Assert.Equal(expected: 110000, actual: responseText.Length);
            }
        }

        [ConditionalFact]
        public async Task ReadAndWriteEcho()
        {
            var body = new string('a', 100000);
            var content = new StringContent(body);
            var response = await _fixture.Client.PostAsync("ReadAndWriteEcho", content);
            var responseText = await response.Content.ReadAsStringAsync();

            Assert.Equal(body, responseText);
        }

        [ConditionalFact]
        public async Task ReadAndWriteCopyToAsync()
        {
            var body = new string('a', 100000);
            var content = new StringContent(body);
            var response = await _fixture.Client.PostAsync("ReadAndWriteCopyToAsync", content);
            var responseText = await response.Content.ReadAsStringAsync();<commit_msg>Reenable concurrent read/write test (#25017)<commit_after>// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Testing;
using Xunit;

namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
{
    [Collection(IISTestSiteCollection.Name)]
    public class SynchronousReadAndWriteTests: FixtureLoggedTest
    {
        private readonly IISTestSiteFixture _fixture;

        public SynchronousReadAndWriteTests(IISTestSiteFixture fixture): base(fixture)
        {
            _fixture = fixture;
        }

        [ConditionalFact]
        public async Task ReadAndWriteSynchronously()
        {
            var content = new StringContent(new string('a', 100000));
            for (int i = 0; i < 500; i++)
            {
                var response = await _fixture.Client.PostAsync("ReadAndWriteSynchronously", content);
                var responseText = await response.Content.ReadAsStringAsync();

                Assert.Equal(expected: 110000, actual: responseText.Length);
            }
        }

        [ConditionalFact]
        public async Task ReadAndWriteEcho()
        {
            var body = new string('a', 100000);
            var content = new StringContent(body);
            var response = await _fixture.Client.PostAsync("ReadAndWriteEcho", content);
            var responseText = await response.Content.ReadAsStringAsync();

            Assert.Equal(body, responseText);
        }

        [ConditionalFact]
        public async Task ReadAndWriteCopyToAsync()
        {
            var body = new string('a', 100000);
            var content = new StringContent(body);
            var response = await _fixture.Client.PostAsync("ReadAndWriteCopyToAsync", content);
            var responseText = await response.Content.ReadAsStringAsync();
{'fraction_non_alphanumeric': 0.08780014552510308, 'fraction_numerical': 0.016735386854232356, 'mean_word_length': 2.6239015817223197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5221748', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1049, 'n_words': 272}