diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 65f23eb62ee0952..0baee753e5828ef 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -53,7 +53,7 @@ jobs: - job: Ubuntu_PR_Tests displayName: Ubuntu PR Tests dependsOn: Prebuild - condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) + condition: false # and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: vmImage: ubuntu-16.04 @@ -137,19 +137,19 @@ jobs: strategy: matrix: - win32: - arch: win32 - buildOpt: - testRunTitle: '$(System.PullRequest.TargetBranch)-win32' - testRunPlatform: win32 + #win32: + # arch: win32 + # buildOpt: + # testRunTitle: '$(System.PullRequest.TargetBranch)-win32' + # testRunPlatform: win32 win64: arch: amd64 buildOpt: '-p x64' testRunTitle: '$(System.PullRequest.TargetBranch)-win64' testRunPlatform: win64 - winarm64: - arch: arm64 - buildOpt: '-p arm64' + #winarm64: + # arch: arm64 + # buildOpt: '-p arm64' maxParallel: 4 steps: diff --git a/.azure-pipelines/win32.pmc b/.azure-pipelines/win32.pmc new file mode 100644 index 000000000000000..f5796692bcef883 Binary files /dev/null and b/.azure-pipelines/win32.pmc differ diff --git a/.azure-pipelines/windows-steps.yml b/.azure-pipelines/windows-steps.yml index f502c40637c310a..709edaf47d5c991 100644 --- a/.azure-pipelines/windows-steps.yml +++ b/.azure-pipelines/windows-steps.yml @@ -21,12 +21,24 @@ steps: displayName: 'Display build info' condition: and(succeeded(), variables['testRunPlatform']) -- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" --tempdir="$(Build.BinariesDirectory)\test" +- powershell: | + iwr https://live.sysinternals.com/procmon.exe -OutFile procmon.exe + mkdir -Force procmonlog + .\procmon.exe /AcceptEula /Quiet /BackingFile procmonlog\data.pml /LoadConfig .\.azure-pipelines\win32.pmc + +- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" --tempdir="$(Build.BinariesDirectory)\test" test_ctypes -m test_load_dll_with_flags displayName: 'Tests' condition: and(succeeded(), variables['testRunPlatform']) env: PREFIX: $(Py_OutDir)\$(arch) +- powershell: .\procmon.exe /Terminate + condition: true + +- publish: procmonlog + artifact: procmon + condition: true + - task: PublishTestResults@2 displayName: 'Publish Test Results' inputs: diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index a62044e370af69f..5fef39e3ce44d2e 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -135,16 +135,23 @@ def test_load_dll_with_flags(self): shutil.copy(os.path.join(os.path.dirname(src), "sqlite3" + ext), os.path.join(tmp, "sqlite3" + ext)) + if test.support.verbose: + print("PRE TEST", tmp, os.listdir(tmp)) + def should_pass(command): with self.subTest(command): + if test.support.verbose: + print(command, tmp, os.listdir(tmp)) subprocess.check_output( [sys.executable, "-c", "from ctypes import *; import nt;" + command], - cwd=tmp + cwd=tmp, ) def should_fail(command): with self.subTest(command): + if test.support.verbose: + print(command, tmp, os.listdir(tmp)) with self.assertRaises(subprocess.CalledProcessError): subprocess.check_output( [sys.executable, "-c", @@ -158,11 +165,8 @@ def should_fail(command): # Relative path (but not just filename) should succeed should_pass("WinDLL('./_sqlite3.dll')") - # XXX: This test has started failing on Azure Pipelines CI. See - # bpo-40214 for more information. - if 0: - # Insecure load flags should succeed - should_pass("WinDLL('_sqlite3.dll', winmode=0)") + # Insecure load flags should succeed + should_pass("WinDLL('_sqlite3.dll', winmode=0)") # Full path load without DLL_LOAD_DIR shouldn't find dependency should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +