<commit_before>using System.Threading.Tasks;
using Xunit;
using Orleans.Runtime;
using UnitTests.GrainInterfaces;
using UnitTests.Tester;
using System;
using Tester;

namespace UnitTests.General
{
    public class RequestContextTests : HostedTestClusterEnsureDefaultStarted
    {
        [Fact, TestCategory("RequestContext"), TestCategory("Functional")]
        public async Task RequestContextCallerToCalleeFlow()
        {
            var grain = GrainFactory.GetGrain<ISimplePersistentGrain>(random.Next());
            // Set context to send to the grain
            RequestContext.Set("GrainInfo", 10);
            // This grain method reads the context and returns it
            var infoFromGrain = await grain.GetRequestContext();
            Assert.NotNull(infoFromGrain);
            Assert.True((int)infoFromGrain == 10);
        }

        [Fact, TestCategory("RequestContext"), TestCategory("Functional")]
        public async Task RequestContextCalleeToCallerFlow()
        {
            await Xunit.Assert.ThrowsAsync(typeof(Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException), async () =>
            {
                var grain = GrainFactory.GetGrain<ISimplePersistentGrain>(random.Next());
                // This method in the grain does RequestContext.Set
                await grain.SetRequestContext(15);
                // Read the info set in the grain
                var infoFromGrain = RequestContext.Get("GrainInfo");
                Assert.NotNull(infoFromGrain);
                Assert.True((int)infoFromGrain == 15);
            });
        }

    }
}
<commit_msg>Ignoring failing test (that didn't work correctly for a very long time)<commit_after>using System.Threading.Tasks;
using Xunit;
using Orleans.Runtime;
using UnitTests.GrainInterfaces;
using UnitTests.Tester;

namespace UnitTests.General
{
    public class RequestContextTests : HostedTestClusterEnsureDefaultStarted
    {
        [Fact, TestCategory("RequestContext"), TestCategory("Functional")]
        public async Task RequestContextCallerToCalleeFlow()
        {
            var grain = GrainFactory.GetGrain<ISimplePersistentGrain>(random.Next());
            // Set context to send to the grain
            RequestContext.Set("GrainInfo", 10);
            // This grain method reads the context and returns it
            var infoFromGrain = await grain.GetRequestContext();
            Assert.NotNull(infoFromGrain);
            Assert.True((int)infoFromGrain == 10);
        }

        [Fact(Skip = "Was failing before (just masked as a Pass), needs fixing or removing"), TestCategory("RequestContext"), TestCategory("Functional")]
        public async Task RequestContextCalleeToCallerFlow()
        {
            var grain = GrainFactory.GetGrain<ISimplePersistentGrain>(random.Next());
            // This method in the grain does RequestContext.Set
            await grain.SetRequestContext(15);
            // Read the info set in the grain
            var infoFromGrain = RequestContext.Get("GrainInfo");
            Assert.NotNull(infoFromGrain);
            Assert.True((int)infoFromGrain == 15);
        }
    }
}
{'fraction_non_alphanumeric': 0.09064885496183206, 'fraction_numerical': 0.005089058524173028, 'mean_word_length': 2.6740654205607477, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, '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': '5916870', 'n_tokens_mistral': 823, 'n_tokens_neox': 793, 'n_words': 196}