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

TabTests.cpp test cases fail to run - TAEF harness fails to run with "[HRESULT: 0x80270254] Failed to create the test host process for out of process test execution" #2472

Closed
metathinker opened this issue Aug 19, 2019 · 1 comment · Fixed by #3833
Assignees
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Meta The product is the management of the products. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@metathinker
Copy link
Contributor

metathinker commented Aug 19, 2019

On my computer, the test case file src\cascadia\LocalTests_TerminalApp\TabTests.cpp fails to run test setup with the above error message. I'm not sure if this is a general problem or just in my setup, but these tests don't seem to run in Azure DevOps CI (I checked test run 31597) so I can't be sure.

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.295]
Windows Terminal version: current master commit 734fc1d

Steps to reproduce

  1. Checkout the Terminal repo.
  2. Run tools\razzle.cmd & bz rel to get a successful build.
  3. Run: "%TAEF%" bin\%PLATFORM%\Release\LocalTests_TerminalApp\TerminalApp.LocalTests.dll /name:"TerminalAppLocalTests::TabTests::*"

Expected behavior

All tests pass.

Actual behavior

The test file does not run at all, with error 0x80270254 == E_APPLICATION_NOT_REGISTERED (lines manually wrapped):

X:\> "%TAEF%"
  bin\x64\Release\LocalTests_TerminalApp\TerminalApp.LocalTests.dll
  /name:"TerminalAppLocalTests::TabTests::*"

Test Authoring and Execution Framework v10.38k for x64
TAEF: Deploying custom AppXManifest...
  Copying X:\bin\x64\Release\LocalTests_TerminalApp\TerminalApp.LocalTests.AppxManifest.xml
  to X:\bin\x64\Release\LocalTests_TerminalApp\AppXManifest.xml
Warning: TAEF: Using TE.ProcessHost.exe as the Application Executable for UAP tests
  is deprecated, please consider using TE.ProcessHost.UAP.exe in your custom manifest.
Error: TAEF: [HRESULT: 0x80270254] Failed to create the test host process for
  out of process test execution. (The IApplicationActivationManager::
  ActivateApplication call failed while using a default host. TAEF's ETW logs
  which are gathered with the /enableEtwLogging switch should contain
  events from relevant providers that may help to diagnose the failure.)

StartGroup: TerminalAppLocalTests::TabTests::TryInitXamlIslands
EndGroup: TerminalAppLocalTests::TabTests::TryInitXamlIslands [Blocked]

StartGroup: TerminalAppLocalTests::TabTests::TryCreateLocalWinRTType
EndGroup: TerminalAppLocalTests::TabTests::TryCreateLocalWinRTType [Blocked]

StartGroup: TerminalAppLocalTests::TabTests::TryCreateXamlObjects
EndGroup: TerminalAppLocalTests::TabTests::TryCreateXamlObjects [Blocked]

StartGroup: TerminalAppLocalTests::TabTests::TryCreateTab
EndGroup: TerminalAppLocalTests::TabTests::TryCreateTab [Blocked]

Summary of TAEF Warnings:
    Warning: TAEF: Using TE.ProcessHost.exe as the Application Executable for UAP tests
      is deprecated, please consider using TE.ProcessHost.UAP.exe in your custom manifest.

Summary of Errors Outside of Tests:
    Error: TAEF: [HRESULT: 0x80270254] Failed to create the test host process for
      out of process test execution. (The IApplicationActivationManager::
      ActivateApplication call failed while using a default host. TAEF's ETW logs
      which are gathered with the /enableEtwLogging switch should contain
      events from relevant providers that may help to diagnose the failure.)

Summary of Non-passing Tests:
    TerminalAppLocalTests::TabTests::TryInitXamlIslands [Blocked]
    TerminalAppLocalTests::TabTests::TryCreateLocalWinRTType [Blocked]
    TerminalAppLocalTests::TabTests::TryCreateXamlObjects [Blocked]
    TerminalAppLocalTests::TabTests::TryCreateTab [Blocked]

Summary: Total=4, Passed=0, Failed=0, Blocked=4, Not Run=0, Skipped=0

Creating the ETW log and parsing it with Windows' built-in tracerpt.exe tool yields a number of interesting errors. As best as I can tell from my very limited knowledge, there was a problem with the AppX package extensions (<Extension> elements in AppXManifest.xml).

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="CombaseTraceLoggingProvider" Guid="{1aff6089-e863-4d36-bdfd-3581f07440be}" />
    <EventID>0</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x0</Keywords>
    <TimeCreated SystemTime="2019-08-18T22:19:27.701635500-07:00" />
    <Execution ProcessID="8272" ThreadID="11028" ProcessorID="0" KernelTime="315" UserTime="405" />
    <Channel />
    <Computer />
  </System>
  <EventData>
    <!-- Michael: This is 0x80040154 == REGDB_E_CLASSNOTREG
         "Class not registered" -->
    <Data Name="hresult">-2147221164</Data>
    <Data Name="code"></Data>
    <Data Name="message"></Data>
    <Data Name="function"></Data>
    <Data Name="fileName">onecore\com\combase\extensioncatalog\extensioncatalog.cpp</Data>
    <Data Name="lineNumber">    1215</Data>
  </EventData>
  <RenderingInfo Culture="en-US">
    <Task>ComError</Task>
  </RenderingInfo>
</Event>

[snip snip]

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ActivationManager" Guid="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" />
    <EventID>0</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x0</Keywords>
    <TimeCreated SystemTime="2019-08-18T22:19:27.702335700-07:00" />
    <Execution ProcessID="8272" ThreadID="11028" ProcessorID="2" KernelTime="315" UserTime="405" />
    <Channel />
    <Computer />
  </System>
  <EventData>
    <Data Name="PartA_PrivTags">16777216</Data>
    <ComplexData Name="wilActivity">
      <!-- Michael: This is 0x80270254 == E_APPLICATION_NOT_REGISTERED
           "This app does not support the contract specified or is not installed." -->
      <Data Name="hresult">2150040148</Data>
      <Data Name="fileName">onecoreuap\base\appmodel\execmodel\modern\activationmanager\extensionhelpers.cpp</Data>
      <Data Name="lineNumber">     221</Data>
      <Data Name="module">activationmanager.dll</Data>
      <Data Name="failureType">       1</Data>
      <Data Name="message"></Data>
      <Data Name="threadId">   11028</Data>
      <Data Name="callContext">\ForegroundActivation</Data>
      <Data Name="originatingContextId">       8</Data>
      <Data Name="originatingContextName">ForegroundActivation</Data>
      <Data Name="originatingContextMessage"></Data>
      <Data Name="currentContextId">       8</Data>
      <Data Name="currentContextName">ForegroundActivation</Data>
      <Data Name="currentContextMessage"></Data>
      <Data Name="failureId">      32</Data>
      <Data Name="failureCount">      32</Data>
      <Data Name="function"></Data>
    </ComplexData>
  </EventData>
  <RenderingInfo Culture="en-US">
    <Task>ActivityError</Task>
  </RenderingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ActivationManager" Guid="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" />
    <EventID>0</EventID>
    <Version>0</Version>
    <Level>5</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x0</Keywords>
    <TimeCreated SystemTime="2019-08-18T22:19:27.702384600-07:00" />
    <Execution ProcessID="8272" ThreadID="11028" ProcessorID="2" KernelTime="315" UserTime="405" />
    <Channel />
    <Computer />
  </System>
  <EventData>
    <!-- Michael: This is E_APPLICATION_NOT_REGISTERED
         "This app does not support the contract specified or is not installed." -->
    <Data Name="HRESULT">0x80270254</Data>
    <Data Name="File">onecoreuap\base\appmodel\execmodel\modern\activationmanager\extensionhelpers.cpp</Data>
    <Data Name="Line">     221</Data>
    <Data Name="failure-&gt;pszFunction"></Data>
    <Data Name="failure-&gt;pszMessage"></Data>
    <Data Name="failure-&gt;pszCode"></Data>
    <Data Name="GetCurrentThreadId()">   11028</Data>
    <Data Name="static_cast&lt;DWORD&gt;(failure-&gt;type)">       1</Data>
    <Data Name="failure-&gt;cFailureCount">32</Data>
  </EventData>
  <RenderingInfo Culture="en-US">
    <Task>WIL_Failover</Task>
  </RenderingInfo>
</Event>
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 19, 2019
@zadjii-msft
Copy link
Member

So for the record, these tests are designed to not run in CI. Unfortunately the tests require Windows 1903, and the CI lab machines are all running Server 2019, which is actually 1809 :(.

This is a known issue with the TabTests currently, but I haven't had a chance to dig in deeper. When I wrote them originally, I was under the impression that it was an OS bug. If you could help us figure out why these don't work, I'd officially owe you a beer when I get back to campus :P

@zadjii-msft zadjii-msft added Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Meta The product is the management of the products. labels Aug 19, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 19, 2019
@DHowett-MSFT DHowett-MSFT added Help Wanted We encourage anyone to jump in on these. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 19, 2019
@zadjii-msft zadjii-msft self-assigned this Dec 4, 2019
@zadjii-msft zadjii-msft added this to the Terminal-1912 milestone Dec 4, 2019
@zadjii-msft zadjii-msft mentioned this issue Dec 4, 2019
3 tasks
@ghost ghost added the In-PR This issue has a related PR label Dec 4, 2019
@ghost ghost closed this as completed in #3833 Dec 6, 2019
ghost pushed a commit that referenced this issue Dec 6, 2019
## Summary of the Pull Request

Fix the `TabTests`, and enable testing of types with XAML content. The `TabTests` were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably. 

We've gotten them fixed now with _one weird trick_ <sup>doctors hate me</sup>. As long as there isn't an `App.xbf` in the test's output directory, then the tests will deploy just fine.

We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, `CppwinrtTailored.h`.

## References

## PR Checklist
* [x] Closes #2472
* [x] I work here
* [x] Tests added/passed - you better believe it
* [n/a] Requires documentation to be updated

## Validation Steps Performed

![image](https://user-images.githubusercontent.com/18356694/70185192-ef1d0b00-16ae-11ea-8799-b77061e3cdb0.png)
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 6, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Meta The product is the management of the products. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants