Skip to content

Instantly share code, notes, and snippets.

Console log: 'System.Net.Sockets.Tests' from job 93f31455-92dc-4293-9906-96117cc681c8 workitem ce7ce536-f347-49cb-b6f2-f083b0982a70 (osx.1015.amd64.open) executed on machine dci-macpro-09.local
+ ./RunTests.sh --runtime-path /tmp/helix/working/993B086D/p
----- start Thu Jan 21 09:13:50 PST 2021 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/993B086D/p/dotnet exec --runtimeconfig System.Net.Sockets.Tests.runtimeconfig.json --depsfile System.Net.Sockets.Tests.deps.json xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
popd
===========================================================================================================
/private/tmp/helix/working/993B086D/w/B692097E/e /private/tmp/helix/working/993B086D/w/B692097E/e
Discovering: System.Net.Sockets.Tests (method display = ClassAndMethod, method display options = Non
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
namespace HangSockets
{
class Program
{
#include <cstdio>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
internal static class RetryHelper
{
public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int> backoffFunc = null);
}
// Throws custom exceptions, which trigger retries:
internal static class TryAssert
{
public static void Equal(...);
public static void True(...);

Proposed API

I propose to expose a public safe handle type with methods to set and query custom options. These methods would be a direct wrappers around WinHttpSetOption and WinHttpQueryOption, similarly to the concept of Socket.SetRawSocketOption.

public class SafeWinHttpHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
    public uint GetWinHttpOption(uint option); 
 public void SetWinHttpOption(uint option, uint optionData);
go to runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress
run
1. Linux: ./run-docker-compose.sh -b -clientstressargs "-maxExecutionTime 720"
2. Windows: .\run-docker-compose.ps1 -b -w -clientstressargs "-maxExecutionTime 720"
run again for HTTP/1.1
1. Linux: ./run-docker-compose.sh -b -clientstressargs "-maxExecutionTime 720 -http 1.1"
2. Windows: .\run-docker-compose.ps1 -b -w -clientstressargs "-maxExecutionTime 720 -http 1.1"
sudo apt-get install clang-9
sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool
sudo apt-get install build-essential
sudo apt-get install python
sudo apt-get install curl
sudo apt-get install git
sudo apt-get install lldb-6.0
sudo apt-get install liblldb-6.0-dev
using System;
using System.IO;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
namespace KilledByPipes
{
class Program
{
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities;
using Xunit;
using Xunit.Abstractions;
namespace System.Net.Sockets.Tests
{
public class Repro31570 : SocketTestHelperBase<SocketHelperEap>