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: System.Runtime.Tests.ProfileOptimizationTest/ProfileOptimization_CheckFileExists #27147

Closed
ghost opened this issue Aug 16, 2018 · 12 comments · Fixed by dotnet/corefx#31810
Labels
area-System.Runtime test-run-core Test failures in .NET Core test runs
Milestone

Comments

@ghost
Copy link

ghost commented Aug 16, 2018

Opened on behalf of @Sunny-pu

The test System.Runtime.Tests.ProfileOptimizationTest/ProfileOptimization_CheckFileExists has failed.

Assert.True() Failure
Expected: True
Actual: False

    Stack Trace:

       at System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists() in /root/corefx-1952310/src/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.netcoreapp.cs:line 26

Build : 3.0 - 20180816.01 (Core Tests)
Failing configurations:

  • RedHat.69.Amd64-x64
    • Release

Details:https://mc.dot.net/#/product/netcore/30/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180816.01/workItem/System.Runtime.Extensions.Tests/analysis/xunit/System.Runtime.Tests.ProfileOptimizationTest~2FProfileOptimization_CheckFileExists

@danmoseley
Copy link
Member

@MarcoRossignoli @brianrob if profiling failed in this test for some reason, would it have failed before this point, or been silent? Or maybe we just need to sleep and retry a bit because profiling hasn't started quick enough?

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Aug 16, 2018

@brianrob @danmosemsft strange...first time i see that...is this first fail?However...if you agree i could add 5 second sleep between StartProfile and return...and some retry on Exists, do you agree?

@danmoseley
Copy link
Member

@MarcoRossignoli yes a sleep/retry would be good, but please write it such that it does not sleep in the normal case, only in the failure case.

@danmoseley
Copy link
Member

@MarcoRossignoli here's a hit, again on RedHat69 release

https://mc.dot.net/#/product/netcore/30/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180917.04/workItem/System.Runtime.Extensions.Tests/wilogs

2018-09-17 08:49:36,041: INFO: proc(55): run_and_log_output: Output: �[m�[31;1m    System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists [FAIL]
2018-09-17 08:49:36,042: INFO: proc(55): run_and_log_output: Output: �[m�[37m      Assert.True() Failure
2018-09-17 08:49:36,042: INFO: proc(55): run_and_log_output: Output: �[m�[37m      Expected: True
2018-09-17 08:49:36,042: INFO: proc(55): run_and_log_output: Output: �[m�[37m      Actual:   False
2018-09-17 08:49:36,043: INFO: proc(55): run_and_log_output: Output: �[m�[30;1m      Stack Trace:
2018-09-17 08:49:36,050: INFO: proc(55): run_and_log_output: Output: �[m�[37m        /root/corefx-2036320/src/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.netcoreapp.cs(41,0): at System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists()
2018-09-17 08:49:36,051: INFO: proc(55): run_and_log_output: Output: �[m�[30;1m      Output:
2018-09-17 08:49:36,051: INFO: proc(55): run_and_log_output: Output: �[m�[37m        We'll test write permission on path 'dfyd322r.lhn'
2018-09-17 08:49:36,809: INFO: proc(55): run_and_log_output: Output: �[m�[37m  Finished:    System.Runtime.Extensions.Tests

I guess this means that it successfully wrote "42" to the file

The two asserts are

            Assert.True(fileInfo.Exists);
             Assert.True(fileInfo.Length > 0);

The previous failure line was the first one, now it's the second one. Line numbers can be one-off for whatever reason (this is release) so it's not clear which assert fired.

It might be worth logging a message after successfully writing to the file, and adding strings to these two asserts so we'll know for sure which is firing.

@danmoseley
Copy link
Member

I'll update the test

@rmkerr
Copy link
Contributor

rmkerr commented Oct 9, 2018

I think this is the last consistently occurring failure in the daily test runs. Every run on RedHat 6.9 fails. RedHat 6.9 is interesting because it's only test leg that runs on a single core VM, but I wasn't able to repro running with -maxthreads 1 on my machine.

For reference, here's the output from the latest failure:

2018-10-09 08:48:04,657: INFO: proc(55): run_and_log_output: Output: �[m�[31;1m    System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists [FAIL]
2018-10-09 08:48:04,658: INFO: proc(55): run_and_log_output: Output: �[m�[37m      'ProfileOptimization_CheckFileExists_18_0da21f98' does not exist
2018-10-09 08:48:04,658: INFO: proc(55): run_and_log_output: Output: �[m�[37m      Expected: True
2018-10-09 08:48:04,658: INFO: proc(55): run_and_log_output: Output: �[m�[37m      Actual:   False
2018-10-09 08:48:04,659: INFO: proc(55): run_and_log_output: Output: �[m�[30;1m      Stack Trace:
2018-10-09 08:48:04,668: INFO: proc(55): run_and_log_output: Output: �[m�[37m        /root/corefx-2100476/src/System.Runtime.Extensions/tests/System/Runtime/ProfileOptimization.netcoreapp.cs(49,0): at System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists()

@MarcoRossignoli
Copy link
Member

@danmoseley
Copy link
Member

Until we know, we should disable this test against this issue number.

@danmoseley
Copy link
Member

@brianrob is it possible the API is not closing the file synchronously?

@brianrob
Copy link
Member

Adding @noahfalk who owns this feature now. The profile should be closed by the time the process exits. Runtime shutdown gets blocked to write the file out. If it doesn't exist by the time the process is actually gone then it's possible that there is a delay in the file actually being written out to disk, but I would expect the OS to handle this if you ask to open the file.

@danmoseley
Copy link
Member

Could be a Redhat quirk...

@noahfalk
Copy link
Member

I used to own it, adding @kouvel who is the current owner

jkotas referenced this issue Jan 12, 2020
Fixes #423
Closes dotnet/corefx#24525
Closes dotnet/corefx#37739
Closes dotnet/corefx#31792
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime test-run-core Test failures in .NET Core test runs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants