Skip to content

SendFileGetsCanceledByDispose failed with ObjectDisposedException  #75354

Closed
@danmoseley

Description

@danmoseley

I'm not sure whether this is specific to the test, or just random timing that could affect any test (in which case this issue could be closed as a dupe maybe).

Was running locally, with today's main, on Windows 21H2.

      <test name="System.Net.Sockets.Tests.SendFile_CancellableTask.SendFileGetsCanceledByDispose(owning: True)" type="System.Net.Sockets.Tests.SendFile_CancellableTask" method="SendFileGetsCanceledByDispose" time="0.2562016" result="Fail">
        <failure exception-type="System.ObjectDisposedException">
          <message><![CDATA[System.ObjectDisposedException : Cannot access a disposed object.\r\nObject name: 'System.Net.Sockets.Socket'.]]></message>
          <stack-trace><![CDATA[   at System.Net.Sockets.Socket.ThrowIfDisposed() in C:\git\runtime\src\libraries\System.Net.Sockets\src\System\Net\Sockets\Socket.cs:line 3760
   at System.Net.Sockets.Socket.SendPacketsAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken) in C:\git\runtime\src\libraries\System.Net.Sockets\src\System\Net\Sockets\Socket.cs:line 2984
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.SendPacketsAsync(Socket socket, CancellationToken cancellationToken) in C:\git\runtime\src\libraries\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 1141
   at System.Net.Sockets.Socket.SendFileAsync(String fileName, ReadOnlyMemory`1 preBuffer, ReadOnlyMemory`1 postBuffer, TransmitFileOptions flags, CancellationToken cancellationToken) in C:\git\runtime\src\libraries\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 730
   at System.Net.Sockets.Socket.SendFileAsync(String fileName, CancellationToken cancellationToken) in C:\git\runtime\src\libraries\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 655
   at System.Net.Sockets.Tests.SocketHelperCancellableTask.SendFileAsync(Socket s, String fileName) in C:\git\runtime\src\libraries\System.Net.Sockets\tests\FunctionalTests\SocketTestHelper.cs:line 287
   at System.Net.Sockets.Tests.SocketTestHelperBase`1.SendFileAsync(Socket s, String fileName) in C:\git\runtime\src\libraries\System.Net.Sockets\tests\FunctionalTests\SocketTestHelper.cs:line 445
   at System.Net.Sockets.Tests.SendFile`1.<>c__DisplayClass10_1.<<SendFileGetsCanceledByDispose>b__2>d.MoveNext() in C:\git\runtime\src\libraries\System.Net.Sockets\tests\FunctionalTests\SendFile.cs:line 270
--- End of stack trace from previous location ---
   at System.Net.Sockets.Tests.SendFile`1.<>c__DisplayClass10_0.<<SendFileGetsCanceledByDispose>b__0>d.MoveNext() in C:\git\runtime\src\libraries\System.Net.Sockets\tests\FunctionalTests\SendFile.cs:line 285
--- End of stack trace from previous location ---
   at System.RetryHelper.ExecuteAsync(Func`1 test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in C:\git\runtime\src\libraries\Common\tests\TestUtilities\System\RetryHelper.cs:line 94
   at System.Net.Sockets.Tests.SendFile`1.SendFileGetsCanceledByDispose(Boolean owning) in C:\git\runtime\src\libraries\System.Net.Sockets\tests\FunctionalTests\SendFile.cs:line 254
--- End of stack trace from previous location ---]]></stack-trace>
        </failure>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions