Skip to content

Bug - Defaulting $(Platform) to Any CPU causes tests to hang indefinitely / time out. #4409

Open
@cmeyertons

Description

@cmeyertons

Background and Motivation

I was piloting Aspire into a new proof-of-concept service at our organization and ran into this issue.

In our company's application template, we have a custom Directory.Build.props file etc etc.

Out of the box:
✔️ The application runs and debugs seamlessly!
❌ The tests hang indefinitely

After some (much) process of elimination, the culprit is defaulting the <Platform> to Any CPU 🤔

Steps to reproduce

  1. Create a solution using the Aspire Starter Application with the following options
  • - Configure for HTTPS
  • - Use Redis...
  • - Create a test project
  1. Build & run the tests, observe everything passes.
  2. Add a Directory.Build.Props to the solution root with the following:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Platform Condition=" '$(Platform)' == '' ">Any CPU</Platform>
  </PropertyGroup>
</Project>

⚠️ Yes, the above is probably not needed and came way before my time. I can easily remove the offending line, but figured I would escalate this to the team as it gave me trouble and hope to not have others fall into the same trap😅

  1. Observe the tests now hang indefinitely and time out.

Expectation

I would expect this behavior to:

  1. not happen at all (i'm not sure why it's happening, i did some cursory looking at the Aspire code and nothing jumped out)
  2. consistently happen when running the application vs testing 🤷‍♂️

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationarea-app-testingIssues pertaining to the APIs in Aspire.Hosting.Testing

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions