Skip to content

Conversation

@adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Dec 15, 2020

Removal of the user via Interop.NetUserDel was never working because it was missing CharSet = CharSet.Unicode. I've fixed that and changed the test to:

  • use more unique name than "test"
  • always try to remove the test account first
  • fail (don't swallow the exception) if the creation of the account failed
  • fail (don't ignore error code NERR_UserNotFound) if the removal of the account failed

The user might have been missing rights to read and execute dotnet.exe (for example when build.cmd was executed from Admin PSW) and in that case the test was throwing Access denied from Process.Start. I've changed the test to always add the permission to read and execute before running the .exe

Now it works as expected:

obraz

Fixes #18978

@ghost
Copy link

ghost commented Dec 15, 2020

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

Issue Details

Removal of the user via Interop.NetUserDel was never working because it was missing CharSet = CharSet.Unicode. I've fixed that and changed the test to:
* use more unique name than "test"
* always try to remove the test account first
* fail (don't swallow the exception) if the creation of the account failed
* fail (don't ignore error code NERR_UserNotFound) if the removal of the account failed

The user might have been missing rights to read and execute dotnet.exe (for example when build.cmd was executed from Admin PSW) and in that case the test was throwing Access denied from Process.Start. I've changed the test to always add the permission to read and execute before running the .exe

Now it works as expected:

obraz

Author: adamsitnik
Assignees: -
Labels:

area-System.Diagnostics.Process

Milestone: 6.0.0

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CI is happy I'm happy.

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@adamsitnik
Copy link
Member Author

/azp list

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

We stopped hearing from agent NetCorePublic-Pool 1. Verify the agent machine is running and has a healthy network connection. Anything that terminates an agent process, starves it for CPU, or blocks its network access can cause this error

So here we go again

/azp run runtime-libraries-coreclr outerloop-windows

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik adamsitnik added the disabled-test The test is disabled in source code against the issue label Dec 16, 2020
@adamsitnik
Copy link
Member Author

adamsitnik commented Dec 16, 2020

The CI has failed with a very interesting error:

    System.Diagnostics.Tests.ProcessStartInfoTests.TestUserCredentialsPropertiesOnWindows [FAIL]
      System.DllNotFoundException : Unable to load DLL 'netapi32.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
      Stack Trace:
           at System.Diagnostics.Tests.Interop.NetUserDel(String servername, String username)
        /_/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs(360,0): at System.Diagnostics.Tests.ProcessStartInfoTests.TestUserCredentialsPropertiesOnWindows()

edit: because 'netapi32.dll' is not available on nano

# Conflicts:
#	src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs
@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

If CI is happy I'm happy

The CI is happy and so am I ;)

@ghost ghost locked as resolved and limited conversation to collaborators Jan 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Diagnostics.Process disabled-test The test is disabled in source code against the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.0.0] TestUserCredentialsPropertiesOnWindows failing on Windows (v1.0 only)

2 participants