Skip to content
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

Test failure: ConsoleEncoding.TestEncoding - NotSupportedException : Memory stream is not expandable #73534

Closed
karelz opened this issue Aug 7, 2022 · 5 comments
Assignees
Labels
area-Codegen-Interpreter-mono os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Milestone

Comments

@karelz
Copy link
Member

karelz commented Aug 7, 2022

Test affected:

  • ConsoleEncoding.TestEncoding

Occurrences 4/5-8/7 (incl. PRs) from Kusto (see query below) or Runfo last 30 days: (average 1 failure per week)

Day Run OS
9/7 Rolling run 7799 Debian.10.Amd64 - Mono Interpreter
9/1 PR #74883 Debian.10.Amd64.Open - Mono Interpreter - release/7.0
8/25 PR #74570 Debian.10.Amd64.Open - Mono Interpreter - release/7.0
8/22 PR #74358 Debian.10.Amd64.Open - Mono Interpreter
8/7 Rolling run 1928257 Debian.10.Amd64 - Mono Interpreter
8/5 PR #73482 Debian.10.Amd64 - Mono Interpreter
7/26 PR #72817 Debian.10.Amd64 - Mono Interpreter
7/26 PR #72865 Debian.10.Amd64 - Mono Interpreter
7/20 PR #72154 Debian.10.Amd64 - Mono Interpreter
7/19 PR #72416 Debian.10.Amd64 - Mono Interpreter
7/14 PR #72126 Debian.10.Amd64 - Mono Interpreter
6/14 PR #70731 Debian.10.Amd64 - Mono Interpreter
6/14 PR #70705 Debian.10.Amd64 - Mono Interpreter
5/30 Rolling run Debian.10.Amd64 - Mono Interpreter

Test output: (fails on different strings in different runs)

    ConsoleEncoding.TestEncoding(inputString: "This is Ascii string") [FAIL]
      System.NotSupportedException : Memory stream is not expandable.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs(272,0): at System.IO.MemoryStream.set_Capacity(Int32 value)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs(156,0): at System.IO.MemoryStream.EnsureCapacity(Int32 value)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs(665,0): at System.IO.MemoryStream.Write(ReadOnlySpan`1 buffer)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs(315,0): at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs(208,0): at System.IO.StreamWriter.Dispose(Boolean disposing)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs(65,0): at System.IO.TextWriter.Dispose()
        /_/src/libraries/System.Console/tests/ConsoleEncoding.cs(55,0): at ConsoleEncoding.TestEncoding(String inputString)
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodInvoker.Mono.cs(33,0): at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
let failedTests = (testNameSubstring : string, methodName : string, messageSubstr: string, includePR : bool, includePassedOnRerun : bool) {
cluster('engsrvprod.kusto.windows.net').database('engineeringdata').AzureDevOpsTests
    | where TestName contains testNameSubstring
    | where includePassedOnRerun or (Outcome == 'Failed')
    | extend startOfTestName = indexof_regex(TestName, @"[^.]+$")
    | extend Method = substring(TestName, startOfTestName)
    | extend Type = substring(TestName, 0, startOfTestName - 1)
    | project-away startOfTestName
    | where (methodName == '') or (Method == methodName)
    | where Message contains messageSubstr
    | distinct JobId, WorkItemId, Message, StackTrace, Method, Type, Arguments, Outcome
    | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').Jobs
        | where ((Branch == 'refs/heads/main') or (Branch == 'refs/heads/master') or (includePR and (Source startswith "pr/")))
        | where Type startswith "test/functional/cli/"
            and not(Properties contains "runtime-staging")
        | summarize arg_max(Finished, Properties, Type, Branch, Source, Started, QueueName) by JobId
        | project-rename JobType = Type) on JobId
    | extend PropertiesJson = parse_json(Properties)
    | extend OS = replace_regex(tostring(PropertiesJson.operatingSystem), @'\((.*)\).*|([^\(].*)', @'\1\2')
    | extend Runtime = iif(PropertiesJson.runtimeFlavor == "mono", "Mono", iif(PropertiesJson.DefinitionName contains "coreclr", "CoreCLR", ""))
    | extend TargetBranch = extractjson("$.['System.PullRequest.TargetBranch']", Properties)
    | extend Architecture = PropertiesJson.architecture
    | extend Scenario = iif(isempty(PropertiesJson.scenario), "--", PropertiesJson.scenario)
    //| extend DefinitionName = PropertiesJson.DefinitionName
    | project-away PropertiesJson
};
failedTests(
    '', //testNameSubstring
    'TestEncoding', //methodName
    'Memory stream is not expandable', //messageSubstr
    true,  //includePR
    true); //includePassedOnRerun
@karelz karelz added area-System.Console os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime labels Aug 7, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 7, 2022
@ghost
Copy link

ghost commented Aug 7, 2022

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

Issue Details

Occurrences 4/5-8/7 (incl. PRs) from Kusto (see query below) or Runfo last 120 days: (average 1 failure per week)

Day Run OS
8/7 Rolling run Debian.10.Amd64 - Mono Interpreter
8/5 PR #73482 Debian.10.Amd64 - Mono Interpreter
7/26 PR #72817 Debian.10.Amd64 - Mono Interpreter
7/26 PR #72865 Debian.10.Amd64 - Mono Interpreter
7/20 PR #72154 Debian.10.Amd64 - Mono Interpreter
7/19 PR #72416 Debian.10.Amd64 - Mono Interpreter
7/14 PR #72126 Debian.10.Amd64 - Mono Interpreter
6/14 PR #70731 Debian.10.Amd64 - Mono Interpreter
6/14 PR #70705 Debian.10.Amd64 - Mono Interpreter
5/30 Rolling run Debian.10.Amd64 - Mono Interpreter
let failedTests = (testNameSubstring : string, methodName : string, messageSubstr: string, includePR : bool, includePassedOnRerun : bool) {
cluster('engsrvprod.kusto.windows.net').database('engineeringdata').AzureDevOpsTests
    | where TestName contains testNameSubstring
    | where includePassedOnRerun or (Outcome == 'Failed')
    | extend startOfTestName = indexof_regex(TestName, @"[^.]+$")
    | extend Method = substring(TestName, startOfTestName)
    | extend Type = substring(TestName, 0, startOfTestName - 1)
    | project-away startOfTestName
    | where (methodName == '') or (Method == methodName)
    | where Message contains messageSubstr
    | distinct JobId, WorkItemId, Message, StackTrace, Method, Type, Arguments, Outcome
    | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').Jobs
        | where ((Branch == 'refs/heads/main') or (Branch == 'refs/heads/master') or (includePR and (Source startswith "pr/")))
        | where Type startswith "test/functional/cli/"
            and not(Properties contains "runtime-staging")
        | summarize arg_max(Finished, Properties, Type, Branch, Source, Started, QueueName) by JobId
        | project-rename JobType = Type) on JobId
    | extend PropertiesJson = parse_json(Properties)
    | extend OS = replace_regex(tostring(PropertiesJson.operatingSystem), @'\((.*)\).*|([^\(].*)', @'\1\2')
    | extend Runtime = iif(PropertiesJson.runtimeFlavor == "mono", "Mono", iif(PropertiesJson.DefinitionName contains "coreclr", "CoreCLR", ""))
    | extend TargetBranch = extractjson("$.['System.PullRequest.TargetBranch']", Properties)
    | extend Architecture = PropertiesJson.architecture
    | extend Scenario = iif(isempty(PropertiesJson.scenario), "--", PropertiesJson.scenario)
    //| extend DefinitionName = PropertiesJson.DefinitionName
    | project-away PropertiesJson
};
failedTests(
    '', //testNameSubstring
    'TestEncoding', //methodName
    'Memory stream is not expandable', //messageSubstr
    true,  //includePR
    true); //includePassedOnRerun
Author: karelz
Assignees: -
Labels:

area-System.Console, os-linux, runtime-mono

Milestone: -

@danmoseley
Copy link
Member

When test hits this exception it should log the code page, input encoding and BOM.
It's quite curious it's sporadic and on random strings. Something non deterministic/racy.

@ghost
Copy link

ghost commented Aug 9, 2022

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

Issue Details

Test affected:

  • ConsoleEncoding.TestEncoding

Occurrences 4/5-8/7 (incl. PRs) from Kusto (see query below) or Runfo last 120 days: (average 1 failure per week)

Day Run OS
8/7 Rolling run Debian.10.Amd64 - Mono Interpreter
8/5 PR #73482 Debian.10.Amd64 - Mono Interpreter
7/26 PR #72817 Debian.10.Amd64 - Mono Interpreter
7/26 PR #72865 Debian.10.Amd64 - Mono Interpreter
7/20 PR #72154 Debian.10.Amd64 - Mono Interpreter
7/19 PR #72416 Debian.10.Amd64 - Mono Interpreter
7/14 PR #72126 Debian.10.Amd64 - Mono Interpreter
6/14 PR #70731 Debian.10.Amd64 - Mono Interpreter
6/14 PR #70705 Debian.10.Amd64 - Mono Interpreter
5/30 Rolling run Debian.10.Amd64 - Mono Interpreter

Test output: (fails on different strings in different runs)

    ConsoleEncoding.TestEncoding(inputString: "This is Ascii string") [FAIL]
      System.NotSupportedException : Memory stream is not expandable.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs(272,0): at System.IO.MemoryStream.set_Capacity(Int32 value)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs(156,0): at System.IO.MemoryStream.EnsureCapacity(Int32 value)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/MemoryStream.cs(665,0): at System.IO.MemoryStream.Write(ReadOnlySpan`1 buffer)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs(315,0): at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs(208,0): at System.IO.StreamWriter.Dispose(Boolean disposing)
        /_/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs(65,0): at System.IO.TextWriter.Dispose()
        /_/src/libraries/System.Console/tests/ConsoleEncoding.cs(55,0): at ConsoleEncoding.TestEncoding(String inputString)
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodInvoker.Mono.cs(33,0): at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
let failedTests = (testNameSubstring : string, methodName : string, messageSubstr: string, includePR : bool, includePassedOnRerun : bool) {
cluster('engsrvprod.kusto.windows.net').database('engineeringdata').AzureDevOpsTests
    | where TestName contains testNameSubstring
    | where includePassedOnRerun or (Outcome == 'Failed')
    | extend startOfTestName = indexof_regex(TestName, @"[^.]+$")
    | extend Method = substring(TestName, startOfTestName)
    | extend Type = substring(TestName, 0, startOfTestName - 1)
    | project-away startOfTestName
    | where (methodName == '') or (Method == methodName)
    | where Message contains messageSubstr
    | distinct JobId, WorkItemId, Message, StackTrace, Method, Type, Arguments, Outcome
    | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').Jobs
        | where ((Branch == 'refs/heads/main') or (Branch == 'refs/heads/master') or (includePR and (Source startswith "pr/")))
        | where Type startswith "test/functional/cli/"
            and not(Properties contains "runtime-staging")
        | summarize arg_max(Finished, Properties, Type, Branch, Source, Started, QueueName) by JobId
        | project-rename JobType = Type) on JobId
    | extend PropertiesJson = parse_json(Properties)
    | extend OS = replace_regex(tostring(PropertiesJson.operatingSystem), @'\((.*)\).*|([^\(].*)', @'\1\2')
    | extend Runtime = iif(PropertiesJson.runtimeFlavor == "mono", "Mono", iif(PropertiesJson.DefinitionName contains "coreclr", "CoreCLR", ""))
    | extend TargetBranch = extractjson("$.['System.PullRequest.TargetBranch']", Properties)
    | extend Architecture = PropertiesJson.architecture
    | extend Scenario = iif(isempty(PropertiesJson.scenario), "--", PropertiesJson.scenario)
    //| extend DefinitionName = PropertiesJson.DefinitionName
    | project-away PropertiesJson
};
failedTests(
    '', //testNameSubstring
    'TestEncoding', //methodName
    'Memory stream is not expandable', //messageSubstr
    true,  //includePR
    true); //includePassedOnRerun
Author: karelz
Assignees: -
Labels:

area-System.Console, os-linux, untriaged, area-Codegen-Interpreter-mono, runtime-mono

Milestone: -

@SamMonoRT SamMonoRT added this to the 8.0.0 milestone Aug 9, 2022
@SamMonoRT SamMonoRT removed the untriaged New issue has not been triaged by the area owner label Aug 9, 2022
@SamMonoRT
Copy link
Member

moving to 8.0.0 given it's non-deterministic. Will investigate and propose a backport if we narrow down the issue

@SamMonoRT
Copy link
Member

SamMonoRT commented Aug 3, 2023

I'm not getting hits on recent runs, and Build Analyis tool hasn't picked up hits either. Intentionally closing it, so it get re-opened on next hit to investigate further. https://runfo.azurewebsites.net/search/tests/?q=started%3A%7E14+definition%3Aruntime+name%3A%22consoleencoding.testencoding%22

@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Codegen-Interpreter-mono os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Projects
None yet
Development

No branches or pull requests

5 participants