Skip to content

Some tests do not perform proper Module cleanup #11058

Closed

Description

@anmenaga

In CI we run several different test suites in the same PS runspace.
Some tests do Not cleanup after themselves, leaving loaded modules they were working with.
Sometimes this produces unexpected results and breaks subsequent tests.

Steps to reproduce

  1. add get-module in the beginning of each test file
  2. run tests, notice any non-standard modules
  3. find tests, where those modules are used, and update them with a proper cleanup

Actual behavior

here is example output listing modules that are loaded in the beginning of an unrelated test file

VERBOSE: Listing all loaded modules:
certificateCommon - 
CimCmdlets
HelpersCommon
HelpersRemoting
HelpersSecurity
ImportTrustedManifestWithCallOperator_System32
ImportTrustedManifestWithCmdletExport_System32
ImportTrustedManifestWithDotSourceModAndFnExport_System32
ImportTrustedManifestWithExportFn_System32
ImportTrustedManifestWithNestedModsAndFnExport_System32
ImportTrustedManifestWithNestedModsAndNoExtNoFnExport_System32
ImportTrustedManifestWithNestedModsAndNoFnExport_System32
ImportTrustedManifestWithNoFnExport_System32
ImportTrustedManifestWithTwoMods_System32
ImportTrustedManifestWithWildcardFnExport1_System32
ImportTrustedManifestWithWildcardModFnExport_System32
ImportTrustedManifestWithWildcardNameFnExport_System32
ImportTrustedModuleForTest_System32
ImportTrustedModuleTest_System32
ImportTrustedModuleWithFnExport_System32
ImportTrustedModuleWithNoFnExport_System32
ImportTrustedModuleWithWildcardFnExport_System32
ImportUntrustedManifestWithFnExport
ImportUnTrustedManifestWithFnExport_System32
ImportUntrustedManifestWithNoFnExport
ImportUnTrustedModuleWithFnExport
ImportUnTrustedModuleWithNoFnExport
Microsoft.PowerShell.Archive
Microsoft.PowerShell.Management
Microsoft.PowerShell.Security
Microsoft.PowerShell.Utility
Microsoft.WSMan.Management
ModuleDotSourceNestedExport_System32
ModuleDotSourceNoExportE_System32
ModuleDotSourceNoWildcard_System32
ModuleDotSourceWildcard_System32
ModuleDotSourceWildCardM_System32
ModuleWithUsing_System32
PackageManagement
Pester
pkiTrue
PSDiagnostics
PSSysLog
TestImport
ThreadJob
TrustedImportModule_System32
TrustedParentModule_System32
UntrustedModuleScriptBlockTest
UntrustedScriptFoo

Activity

  1. added
    Issue-Bug
    WG-Quality-Test
    Up-for-Grabs
    on Nov 13, 2019
  2. iSazonov commented on Nov 13, 2019

    @iSazonov
    Collaborator

    Standard and helpers modules should not cause problems.

  3. iSazonov commented on Nov 15, 2019

    @iSazonov
    Collaborator

    Andrew (@anmenaga) Do you agree to close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugResolution-FixedUp-for-GrabsWG-Quality-Test

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions