sillsdev / sillsdev/chorus

Random ChorusMerge failures saying hostpolicy.dll not found

Open
#362 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
5
Forks
26
PR merge metrics
No merged PRs in 30d

Description

While running the Chorus test suite under Visual Studio, I experienced random test flakiness (failures that would pass on the next run, and that passed on a different machine running the exact same code). The failures all looked like this:

Merging sally and bob...
Error: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet\'.
Failed to run as a self-contained app.
- The application was run as a self-contained app because 'C:\Users\vboxuser\code\chorus\output\Debug\net8.0\ChorusMerge.runtimeconfig.json' was not found.
- If this should be a framework-dependent app, add the 'C:\Users\vboxuser\code\chorus\output\Debug\net8.0\ChorusMerge.runtimeconfig.json' file and specify the appropriate framework.
merging test.lift failed!

This may be related to https://www.github.com/dotnet/runtime/issues/3569 and/or https://www.github.com/dotnet/sdk/issues/5973, except that the people reporting those issues seemed to be hitting this behavior consistently, whereas random nature of the failures I'm seeing suggests some kind of race condition in how ChorusMerge gets executed during tests (??).

In case it's useful, here is a list of tests where I've seen this happen:

  • ChorusNotesFileSyncTests.ConflictFileIsCheckedIn
  • SychronizerAdjunctTests.BothMadeChanges_MergeFailure_Fires_SimpleUpdate_WithTrue
  • SychronizerAdjunctTests.CommitWithMergeHasCommitFileAndMergeFile
  • SychronizerAdjunctTests.SendReceiveWithTrivialMergeCallsSimpleUpdate
  • SynchronizerBadSituationTests.Sync_BothChangedBinaryFile_FailureReportedOneChosenSingleHead
  • SynchronizerBadSituationTests.Sync_ExceptionInMergeCode_LeftWith2HeadsAndErrorOutputToProgress
  • SynchronizerBadSituationTests.Sync_MergeFailure_LeavesNoChorusMergeProcessAlive
  • SynchronizerBadSituationTests.Sync_MergeFailure_NoneOfTheOtherGuysFilesMakeItIntoWorkingDirectory
  • SynchronizerBadSituationTests.Sync_MergeTimeoutExceeded_LeavesNoChorusMergeProcessAlive (here the error was "Timed out after waiting 1 second" so this might be something else)
  • SynchronizerBadSituationTests.Sync_MergeWhenThereIsMoreThanOneHeadToMergeWith_MergesBoth
  • SynchronizerBadSituationTests.Sync_RepeatedMergeFailure_WeAreLeftOnOurOwnWorkingDefault
  • SyncScenarioTests.CanCollaborateOnLift
  • SyncScenarioTests.CanShareConflictingChangeViaUsb
  • SyncScenarioTests.TestNewVersion_SallyAndBobUpgradeButFredDelays
  • SyncScenarioTests.TestNewVersion_SallyUpgradesToBobVersion
  • SyncScenarioTests.TipUpdatedPostMerge
  • HgMergeTests.HgMerge_LaunchesChorusMerge

All those failures were on the net8.0 framework run, after the net462 framework had passed those same tests. A different computer running the same tests passed all of the above, on both net462 and net8.0. And recompiling the Chorus project, then re-running the tests, passed those same tests that had failed earlier. So it truly does appear random whether or not this will trigger.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure in the listed net8.0 tests, focusing on the ChorusMerge launch path and the missing ChorusMerge.runtimeconfig.json and hostpolicy.dll messages. Compare runs before and after recompiling the Chorus project, and verify that the affected tests complete reliably without the merge execution error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.