runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Socket SelectTest.Poll_NotReady() fail in ILC mode due to metadata removed for performance reason

Open caesar-chen opened this issue 9 years ago • 8 comments

System.Net.Sockets tests run fine in F5 ('uap') mode. But in ILC ('uap-aot') mode they are failing. It seems that the metadata the test needs to look up has been removed:

        [Theory]
        [InlineData(SelectMode.SelectRead)]
        [InlineData(SelectMode.SelectError)]
        public void Poll_NotReady(SelectMode mode)
        {
            KeyValuePair<Socket, Socket> pair = CreateConnectedSockets();
            try
            {
                Assert.False(pair.Key.Poll(SmallTimeoutMicroseconds, mode));
            }
            finally
            {
                pair.Key.Dispose();
                pair.Value.Dispose();
            }
        }

We get failures like this:

System.Reflection.MissingMetadataException : This operation cannot be carried out because metadata for the following object was removed for performance reasons:\n\n System.Net.Sockets.SelectMode\n\nNo further information is available. Rebuild in debug mode for better information.\n\n

Is this an expected problem from the UWP test runner in ILC mode? Or we need to fix this?

cc: @davidsh

caesar-chen avatar Jun 14 '17 18:06 caesar-chen

cc: @tarekgh @safern

davidsh avatar Jun 14 '17 19:06 davidsh

CC @joperezr

I think this need to be fixed in the ILC toolchain

tarekgh avatar Jun 14 '17 19:06 tarekgh

System.Net.Sockets is more appropriate area than System.Reflection.Metadata.

tmat avatar Jun 14 '17 20:06 tmat

Two ways of fixing this:

  • Have an rd.xml that makes sure that types/members are not optimized out (similar to what I did in PR dotnet/corefx#20995)
  • See if @morganbr 's work and improvements in reflection will fix this on the ILCToolchain.

joperezr avatar Jun 14 '17 22:06 joperezr

@joperezr please complete the rd.xml change and create a future bug for @morganbr. @morganbr 's work will come in later and we'll need this test running sooner.

joshfree avatar Jun 15 '17 02:06 joshfree

If this is something about XUnit theories, the analysis changes won't affect it. Go ahead with rd.xml.

morganbr avatar Jun 15 '17 02:06 morganbr

I will work on completing the rd.xml

caesar-chen avatar Jun 15 '17 17:06 caesar-chen

Fixed with dotnet/corefx#21171

davidsh avatar Jun 20 '17 02:06 davidsh