File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 run : dotnet build src/NetMQ.sln /p:Configuration=Release /verbosity:minimal
1616 - name : test net10.0
1717 run : dotnet test -v n -p:ParallelizeTestCollections=false --configuration Release --no-build -f net10.0 src/NetMQ.Tests/NetMQ.Tests.csproj
18+ macos :
19+ runs-on : macos-latest
20+ permissions :
21+ contents : read
22+ env :
23+ DOTNET_NOLOGO : true
24+ steps :
25+ - uses : actions/checkout@v6
26+ - uses : actions/setup-dotnet@v5
27+ with :
28+ dotnet-version : 10.0.x
29+ - run : dotnet restore src/NetMQ.sln
30+ - name : build
31+ run : dotnet build src/NetMQ.sln /p:Configuration=Release /verbosity:minimal
32+ - name : test net10.0
33+ run : dotnet test -v n -p:ParallelizeTestCollections=false --configuration Release --no-build -f net10.0 src/NetMQ.Tests/NetMQ.Tests.csproj
1834 windows :
1935 runs-on : windows-latest
2036 env :
Original file line number Diff line number Diff line change 11using System ;
22using System . Diagnostics ;
3+ using System . Threading ;
34using NetMQ . Sockets ;
45using Xunit ;
56
@@ -62,5 +63,21 @@ public void NoBlockNoDispose()
6263
6364 NetMQConfig . Cleanup ( block : false ) ;
6465 }
66+
67+ [ Fact ]
68+ public void NoBlockCompletesInBoundedTime ( )
69+ {
70+ // Regression test for https://github.com/zeromq/netmq/issues/1040
71+ // Cleanup(block: false) must return quickly even when a socket has not been
72+ // disposed and the internal poller is actively calling Socket.Select.
73+ // On macOS, Socket.Select can block indefinitely when passed both a read list
74+ // and an error list, causing Cleanup to hang forever without this guard.
75+ _ = new DealerSocket ( ">tcp://localhost:5557" ) ; // intentionally not disposed
76+
77+ var thread = new Thread ( ( ) => NetMQConfig . Cleanup ( block : false ) ) ;
78+ thread . Start ( ) ;
79+ Assert . True ( thread . Join ( TimeSpan . FromSeconds ( 10 ) ) ,
80+ "Cleanup(block: false) did not complete within 10 seconds" ) ;
81+ }
6582 }
6683}
You can’t perform that action at this time.
0 commit comments