Skip to content

SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All test failure #115070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jkotas opened this issue Apr 26, 2025 · 9 comments · Fixed by #115722
Closed

SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All test failure #115070

jkotas opened this issue Apr 26, 2025 · 9 comments · Fixed by #115722
Assignees
Labels
area-System.Net blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented Apr 26, 2025

  System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All [FAIL]
      Assert.Null() Failure: Value is not null
      Expected: null
      Actual:   ParsedMailMessage { Attachments = [], Body = "body", Cc = "cc1@example.com, cc2@example.com", ContentType = text/plain; charset=us-ascii, From = "foo@example.com", ··· }
      Stack Trace:
        /_/src/libraries/System.Net.Mail/tests/Functional/SmtpClientSendMailTest.cs(310,0): at System.Net.Mail.Tests.SmtpClientSendMailTest`1.MultipleRecipients_Failure_All()
        --- End of stack trace from previous location ---

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1026990
Build error leg or test failing: System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All
Pull request: #115065

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All [FAIL]","Assert.Null() Failure: Value is not null","Expected: null","Actual:   ParsedMailMessage"],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Report

Build Definition Test Pull Request
1051505 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115856
1051297 dotnet/runtime System.Net.Mail.Tests.SmtpClientTlsTest_Send.ClientCertificateRequired_Sent #115996
1050786 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115704
1050271 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115958
1048682 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115892
1047142 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115709
1047108 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115388
1046615 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115408
1046558 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115583
1044403 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All
1042988 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115626
1042728 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115549
1042552 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115610
1042137 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115542
1041497 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115566
1040895 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115538
1039403 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #114148
1039168 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115465
1038755 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115437
1037475 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115395
1036735 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115339
1036135 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115251
1035018 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115293
1033711 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115062
1033701 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115252
1032478 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115134
1032154 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #115134
1030580 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All #114148
1030530 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115184
1029780 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #114800
1028546 dotnet/runtime System.Net.Mail.Tests.SmtpClientSendMailTest_SendAsync.MultipleRecipients_Failure_All #115119

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 9 31
@jkotas jkotas added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels Apr 26, 2025
@ghost ghost added the area-System.Net label Apr 26, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 26, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@rzikm rzikm self-assigned this Apr 28, 2025
@rzikm
Copy link
Member

rzikm commented Apr 28, 2025

This seem weird, the client will attempt to send mail even if there are no valid recipients

      Output:
        Server> 220 localhost
        Client> EHLO a006T6A
        Server> 250-localhost, mock server here
              > 250 AUTH PLAIN LOGIN
        Client> MAIL FROM:<foo@example.com>
        Server> 250 Ok
        Client> RCPT TO:<bar@example.com>
        Server> 550 unknown recipient
        Client> RCPT TO:<baz@example.com>
        Server> 550 unknown recipient
        Client> RCPT TO:<cc1@example.com>
        Server> 550 unknown recipient
        Client> RCPT TO:<cc2@example.com>
        Server> 550 unknown recipient
        Client> DATA
        Server> 354 Start mail input; end with <CRLF>.<CRLF>
        Client> MIME-Version: 1.0
              > From: foo@example.com
              > To: bar@example.com, baz@example.com
              > Cc: cc1@example.com, cc2@example.com
              > Date: 27 Apr 2025 16:57:50 +0000
              > Subject: subject
              > Content-Type: text/plain; charset=us-ascii
              > Content-Transfer-Encoding: quoted-printable
              > 
              > body
              > 
              > .
        Server> 250 Ok: queued as 1116
        Client> QUIT
        Server> 221 Bye

@rzikm
Copy link
Member

rzikm commented Apr 28, 2025

The bug is due to

private void SendToCollection()
{
while (_toIndex < _toCollection.Count)
{
MultiAsyncResult result = (MultiAsyncResult)RecipientCommand.BeginSend(_connection,
_toCollection[_toIndex++].GetSmtpAddress(_allowUnicode) + _deliveryNotify,
s_sendToCollectionCompleted, this);
if (!result.CompletedSynchronously)
{
return;
}
string response;
if (!RecipientCommand.EndSend(result, out response))
{
_failedRecipientExceptions.Add(new SmtpFailedRecipientException(_connection.Reader!.StatusCode,
_toCollection[_toIndex - 1].GetSmtpAddress(_allowUnicode), response));
}
}
SendData();
}

In case all sends finish synchronously, we proceed to SendData() without checking if at least one recipient succeeded.

@SakeTao
Copy link

SakeTao commented May 6, 2025

Failed in: runtime-coreclr libraries-jitstress 20250505.1

Failed tests:

net10.0-linux-Release-x64-jitminopts-Ubuntu.2204.Amd64.Open
    - System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All

Error message:

 Assert.Null() Failure: Value is not null
Expected: null
Actual:   ParsedMailMessage { Attachments = [], Body = "body", Cc = "cc1@example.com, cc2@example.com", ContentType = text/plain; charset=us-ascii, From = "foo@example.com", ··· }

Stack trace:

   at System.Net.Mail.Tests.SmtpClientSendMailTest`1.MultipleRecipients_Failure_All() in /_/src/libraries/System.Net.Mail/tests/Functional/SmtpClientSendMailTest.cs:line 310
--- End of stack trace from previous location ---
Queued Pipeline Pipeline_Configuration OS Arch Test Outcome Properties BuildReason
51:00.5 runtime-extra-platforms Release ubuntu.2204.amd64.android.29.open.rt x86 System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All PassedOnRerun {"DefinitionName":"runtime-extra-platforms","System.JobId":"bf46dbf5-7e63-514c-8f02-f313a0e24f72","System.StageAttempt":"1","BuildId":"1034085","BuildNumber":"20250505.2","System.JobAttempt":"1","operatingSystem":"Ubuntu.2204.Amd64.Android.29.Open","AzurePipelinesTestRunId":"27784178","Reason":"Schedule","Project":"public","architecture":"x86","CollectionUri":"https://dev.azure.com/dnceng-public/","runtimeFlavor":"mono","System.JobName":"__default","DefinitionId":"154","System.StageName":"Build","System.PhaseName":"build_android_x86_Release_AllSubsets_Mono","System.PhaseAttempt":"1","configuration":"Release"} Schedule
51:00.5 runtime-extra-platforms Release ubuntu.2204.amd64.android.29.open.rt x86 System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All PassedOnRerun {"DefinitionName":"runtime-extra-platforms","System.JobId":"bf46dbf5-7e63-514c-8f02-f313a0e24f72","System.StageAttempt":"1","BuildId":"1034085","BuildNumber":"20250505.2","System.JobAttempt":"1","operatingSystem":"Ubuntu.2204.Amd64.Android.29.Open","AzurePipelinesTestRunId":"27784178","Reason":"Schedule","Project":"public","architecture":"x86","CollectionUri":"https://dev.azure.com/dnceng-public/","runtimeFlavor":"mono","System.JobName":"__default","DefinitionId":"154","System.StageName":"Build","System.PhaseName":"build_android_x86_Release_AllSubsets_Mono","System.PhaseAttempt":"1","configuration":"Release"} Schedule
10:45.0 runtime Release ubuntu.2204.armarch.open arm64 System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All PassedOnRerun {"System.PhaseName":"libraries_test_run_checked_coreclr_linux_musl_arm64_Release","architecture":"arm64","System.JobAttempt":"1","Reason":"Schedule","DefinitionName":"runtime","operatingSystem":"(Alpine.321.Arm64.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-arm64v8","configuration":"Release","System.StageAttempt":"1","Project":"public","CollectionUri":"https://dev.azure.com/dnceng-public/","runtimeFlavor":"coreclr","AzurePipelinesTestRunId":"27654706","DefinitionId":"129","BuildId":"1030072","System.StageName":"Build","System.JobName":"__default","System.PhaseAttempt":"1","System.JobId":"5d0c0cf7-4d03-5f34-03a4-db2320737fb6","BuildNumber":"20250429.55"} Schedule
10:45.0 runtime Release ubuntu.2204.armarch.open arm64 System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All PassedOnRerun {"System.PhaseName":"libraries_test_run_checked_coreclr_linux_musl_arm64_Release","architecture":"arm64","System.JobAttempt":"1","Reason":"Schedule","DefinitionName":"runtime","operatingSystem":"(Alpine.321.Arm64.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-arm64v8","configuration":"Release","System.StageAttempt":"1","Project":"public","CollectionUri":"https://dev.azure.com/dnceng-public/","runtimeFlavor":"coreclr","AzurePipelinesTestRunId":"27654706","DefinitionId":"129","BuildId":"1030072","System.StageName":"Build","System.JobName":"__default","System.PhaseAttempt":"1","System.JobId":"5d0c0cf7-4d03-5f34-03a4-db2320737fb6","BuildNumber":"20250429.55"} Schedule
57:47.0 runtime-extra-platforms Release ubuntu.2204.amd64.android.29.open.rt x64 System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All PassedOnRerun {"System.PhaseName":"build_android_x64_Release_AllSubsets_Mono","BuildId":"1028177","BuildNumber":"20250428.1","operatingSystem":"Ubuntu.2204.Amd64.Android.29.Open","Project":"public","System.JobName":"__default","System.StageName":"Build","configuration":"Release","architecture":"x64","System.JobAttempt":"1","DefinitionId":"154","DefinitionName":"runtime-extra-platforms","System.StageAttempt":"1","System.JobId":"bb18f708-6684-5381-2c5c-c995f6debaa3","Reason":"Schedule","CollectionUri":"https://dev.azure.com/dnceng-public/","runtimeFlavor":"mono","AzurePipelinesTestRunId":"27589648","System.PhaseAttempt":"1"} Schedule

@wfurt wfurt removed the untriaged New issue has not been triaged by the area owner label May 7, 2025
@wfurt wfurt added this to the 10.0.0 milestone May 7, 2025
@SakeTao
Copy link

SakeTao commented May 12, 2025

Failed in: runtime-coreclr libraries-jitstressregs 20250511.1

Failed tests:

net10.0-linux-Release-x64-jitstressregs0x80-Ubuntu.2204.Amd64.Open
    - System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All

Error message:

 Assert.Null() Failure: Value is not null
Expected: null
Actual:   ParsedMailMessage { Attachments = [], Body = "body", Cc = "cc1@example.com, cc2@example.com", ContentType = text/plain; charset=us-ascii, From = "foo@example.com", ··· }

Stack trace:

   at System.Net.Mail.Tests.SmtpClientSendMailTest`1.MultipleRecipients_Failure_All() in /_/src/libraries/System.Net.Mail/tests/Functional/SmtpClientSendMailTest.cs:line 310
--- End of stack trace from previous location ---

@jakobbotsch
Copy link
Member

@rzikm Given that you have identified the issue, can you submit a fix or disable the test to make it unblocking?

@rzikm
Copy link
Member

rzikm commented May 22, 2025

The bug should be fixed by #115722

@SakeTao
Copy link

SakeTao commented May 23, 2025

Failed in: runtime-coreclr libraries-jitstress 20250522.1

Failed tests:

net10.0-linux-Release-arm-jitstress1_tiered-(Debian.13.Arm32.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7
    - System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All

Error message:

 Assert.Null() Failure: Value is not null
Expected: null
Actual:   ParsedMailMessage { Attachments = [], Body = "body", Cc = "cc1@example.com, cc2@example.com", ContentType = text/plain; charset=us-ascii, From = "foo@example.com", ··· }

Stack trace:

   at System.Net.Mail.Tests.SmtpClientSendMailTest`1.MultipleRecipients_Failure_All() in /_/src/libraries/System.Net.Mail/tests/Functional/SmtpClientSendMailTest.cs:line 310
--- End of stack trace from previous location ---

@SakeTao
Copy link

SakeTao commented May 26, 2025

Failed in: runtime-coreclr libraries-jitstressregs 20250525.1

Failed tests:

net10.0-linux-Release-x64-jitstressregs0x1000-Ubuntu.2204.Amd64.Open
    - System.Net.Mail.Tests.SmtpClientSendMailTest_SendMailAsync.MultipleRecipients_Failure_All

Error message:

 Assert.Null() Failure: Value is not null
Expected: null
Actual:   ParsedMailMessage { Attachments = [], Body = "body", Cc = "cc1@example.com, cc2@example.com", ContentType = text/plain; charset=us-ascii, From = "foo@example.com", ··· }

Stack trace:

   at System.Net.Mail.Tests.SmtpClientSendMailTest`1.MultipleRecipients_Failure_All() in /_/src/libraries/System.Net.Mail/tests/Functional/SmtpClientSendMailTest.cs:line 310
--- End of stack trace from previous location ---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants