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

Tests in master failing due to MissingMethodException #237

Closed
TysonMN opened this issue Jun 30, 2020 · 8 comments
Closed

Tests in master failing due to MissingMethodException #237

TysonMN opened this issue Jun 30, 2020 · 8 comments

Comments

@TysonMN
Copy link
Member

TysonMN commented Jun 30, 2020

There are four tests in master failing because due to a MissingMethodException.

System.MissingMethodException : Method not found: 'System.Double System.Numerics.BigInteger.op_Explicit(System.Numerics.BigInteger)'

Below I have included the full test detail summary for all four tests. I am troubleshooting this issue now. I will comment again soon with more information.

Test Name:	Elmish.WPF.Tests.MergeTests.starting with random items, when merging after shuffling, should contain the merged items and never call create and call update eactly once for each item
Test FullName:	Elmish.WPF.Tests.Elmish.WPF.Tests.MergeTests.Elmish.WPF.Tests.MergeTests.starting with random items, when merging after shuffling, should contain the merged items and never call create and call update eactly once for each item
Test Source:	C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\MergeTests.fs : line 207
Test Outcome:	Failed
Test Duration:	0:00:00

Test Name:	Elmish.WPF.Tests.MergeTests.starting with random items, when merging after shuffling, should contain the merged items and never call create and call update eactly once for each item
Test Outcome:	Failed
Result StackTrace:	
at Elmish.WPF.Tests.MergeTests.starting with random items\, when merging after shuffling\, should contain the merged items and never call create and call update eactly once for each [email protected](Int32 n0)
   at Elmish.WPF.Tests.MergeTests.starting with random items\, when merging after shuffling\, should contain the merged items and never call create and call update eactly once for each [email protected](Int32 sz)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed0, Int32 size)
   at Hedgehog.Property.loop@332-21(Int32 n, Random`1 random, Seed seed, Int32 size, Int32 tests, Int32 discards)
   at Hedgehog.Property.Report(Int32 n, Property`1 p)
   at Hedgehog.Property.Check(Property`1 p)
   at Elmish.WPF.Tests.MergeTests.starting with random items, when merging after shuffling, should contain the merged items and never call create and call update eactly once for each item() in C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\MergeTests.fs:line 207
Result Message:	System.MissingMethodException : Method not found: 'System.Double System.Numerics.BigInteger.op_Explicit(System.Numerics.BigInteger)'.
Test Name:	Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two adjacent items, should contain the merged items and never call create and call update exactly once for each item
Test FullName:	Elmish.WPF.Tests.Elmish.WPF.Tests.MergeTests.Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two adjacent items, should contain the merged items and never call create and call update exactly once for each item
Test Source:	C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\MergeTests.fs : line 164
Test Outcome:	Failed
Test Duration:	0:00:00

Test Name:	Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two adjacent items, should contain the merged items and never call create and call update exactly once for each item
Test Outcome:	Failed
Result StackTrace:	
at Elmish.WPF.Tests.MergeTests.starting with random items\, when merging after swapping two adjacent items\, should contain the merged items and never call create and call update exactly once for each [email protected](Int32 n0)
   at Elmish.WPF.Tests.MergeTests.starting with random items\, when merging after swapping two adjacent items\, should contain the merged items and never call create and call update exactly once for each [email protected](Int32 sz)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed0, Int32 size)
   at Hedgehog.Property.loop@332-21(Int32 n, Random`1 random, Seed seed, Int32 size, Int32 tests, Int32 discards)
   at Hedgehog.Property.Report(Int32 n, Property`1 p)
   at Hedgehog.Property.Check(Property`1 p)
   at Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two adjacent items, should contain the merged items and never call create and call update exactly once for each item() in C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\MergeTests.fs:line 164
Result Message:	System.MissingMethodException : Method not found: 'System.Double System.Numerics.BigInteger.op_Explicit(System.Numerics.BigInteger)'.
Test Name:	Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two items, should contain the merged items and never call create and call update exactly once for each item
Test FullName:	Elmish.WPF.Tests.Elmish.WPF.Tests.MergeTests.Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two items, should contain the merged items and never call create and call update exactly once for each item
Test Source:	C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\MergeTests.fs : line 185
Test Outcome:	Failed
Test Duration:	0:00:00

Test Name:	Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two items, should contain the merged items and never call create and call update exactly once for each item
Test Outcome:	Failed
Result StackTrace:	
at Elmish.WPF.Tests.MergeTests.starting with random items\, when merging after swapping two items\, should contain the merged items and never call create and call update exactly once for each [email protected](Int32 n0)
   at Elmish.WPF.Tests.MergeTests.starting with random items\, when merging after swapping two items\, should contain the merged items and never call create and call update exactly once for each [email protected](Int32 sz)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed0, Int32 size)
   at Hedgehog.Property.loop@332-21(Int32 n, Random`1 random, Seed seed, Int32 size, Int32 tests, Int32 discards)
   at Hedgehog.Property.Report(Int32 n, Property`1 p)
   at Hedgehog.Property.Check(Property`1 p)
   at Elmish.WPF.Tests.MergeTests.starting with random items, when merging after swapping two items, should contain the merged items and never call create and call update exactly once for each item() in C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\MergeTests.fs:line 185
Result Message:	System.MissingMethodException : Method not found: 'System.Double System.Numerics.BigInteger.op_Explicit(System.Numerics.BigInteger)'.
Test Name:	Elmish.WPF.Tests.ViewModelTests+OneWaySeqLazy.given equals returns false and itemEquals returns false, when model is updated, should contain expected items in collection
Test FullName:	Elmish.WPF.Tests.Elmish.WPF.Tests.ViewModelTests+OneWaySeqLazy.Elmish.WPF.Tests.ViewModelTests+OneWaySeqLazy.given equals returns false and itemEquals returns false, when model is updated, should contain expected items in collection
Test Source:	C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\ViewModelTests.fs : line 695
Test Outcome:	Failed
Test Duration:	0:00:00

Test Name:	Elmish.WPF.Tests.ViewModelTests+OneWaySeqLazy.given equals returns false and itemEquals returns false, when model is updated, should contain expected items in collection
Test Outcome:	Failed
Result StackTrace:	
at Elmish.WPF.Tests.ViewModelTests.OneWaySeqLazy.given equals returns false and itemEquals returns false\, when model is updated\, should contain expected items in [email protected](Int32 n0)
   at Elmish.WPF.Tests.ViewModelTests.OneWaySeqLazy.given equals returns false and itemEquals returns false\, when model is updated\, should contain expected items in [email protected](Int32 sz)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed, Int32 size)
   at [email protected](Seed seed0, Int32 size)
   at [email protected](Seed seed, Int32 size)
   at Hedgehog.Tree.bind[a,b](Tree`1 _arg1, FSharpFunc`2 k)
   at [email protected](Seed seed0, Int32 size)
   at Hedgehog.Tree.bind[a,b](Tree`1 _arg1, FSharpFunc`2 k)
   at [email protected](Seed seed0, Int32 size)
   at Hedgehog.Property.loop@332-21(Int32 n, Random`1 random, Seed seed, Int32 size, Int32 tests, Int32 discards)
   at Hedgehog.Property.Report(Int32 n, Property`1 p)
   at Hedgehog.Property.Check(Property`1 p)
   at Elmish.WPF.Tests.ViewModelTests.OneWaySeqLazy.given equals returns false and itemEquals returns false, when model is updated, should contain expected items in collection() in C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\ViewModelTests.fs:line 695
Result Message:	System.MissingMethodException : Method not found: 'System.Double System.Numerics.BigInteger.op_Explicit(System.Numerics.BigInteger)'.
@TysonMN
Copy link
Member Author

TysonMN commented Jun 30, 2020

Pull requests cause our tests to be run on AppVeyor. The most recently completed pull request is #214. The head of the branch for that PR was commit 69d82c3. The tests in that commit were run by AppVeyor, and they all passed. On that commit, the four tests fail when I run them locally on the command line.

In both cases, the tests were run with the Microsoft Test Execution Command Line Tool. The versions were slightly different though:

  • AppVeyor: 16.5.0
  • Local: 16.6.0

@TysonMN
Copy link
Member Author

TysonMN commented Jun 30, 2020

The tests still pass on AppVeyor, which is still using version 16.5.0 of the command line tool.

@TysonMN
Copy link
Member Author

TysonMN commented Jun 30, 2020

Now I locally ran the tests with version 15.9.1 of the command line tool, and four tests still fail for me. So, the issue is probably not the command line tool.

@TysonMN
Copy link
Member Author

TysonMN commented Jun 30, 2020

Another difference between me and AppVeyor is the version of the Microsoft Build Engine.

  • AppVeyor: 16.5.0+d4cbfca49 for .NET Core
  • Local: 16.6.0+5ff7b0c9e for .NET Core
C:\Code\ThirdParty\Elmish.WPF>dotnet build src -c Release
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  SubModelSeq.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModelSeq.Views\bin\Release\netcoreapp3.0\SubModelSeq.Views.dll
  OneWaySeq.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\OneWaySeq.Views\bin\Release\netcoreapp3.0\OneWaySeq.Views.dll
  NewWindow.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\NewWindow.Views\bin\Release\netcoreapp3.0\NewWindow.Views.dll
  UiBoundCmdParam.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\UiBoundCmdParam.Views\bin\Release\netcoreapp3.0\UiBoundCmdParam.Views.dll
  SingleCounter.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SingleCounter.Views\bin\Release\netcoreapp3.0\SingleCounter.Views.dll
  Validation.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\Validation.Views\bin\Release\netcoreapp3.0\Validation.Views.dll
  SubModel.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModel.Views\bin\Release\netcoreapp3.0\SubModel.Views.dll
  SubModelSelectedItem.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModelSelectedItem.Views\bin\Release\netcoreapp3.0\SubModelSelectedItem.Views.dll
  SubModelOpt.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModelOpt.Views\bin\Release\netcoreapp3.0\SubModelOpt.Views.dll
  FileDialogs.CmdMsg.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\FileDialogs.CmdMsg.Views\bin\Release\netcoreapp3.0\FileDialogs.CmdMsg.Views.dll
  FileDialogs.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\FileDialogs.Views\bin\Release\netcoreapp3.0\FileDialogs.Views.dll
  EventBindingsAndBehaviors.Views -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\EventBindingsAndBehaviors.Views\bin\Release\netcoreapp3.0\EventBindingsAndBehaviors.Views.dll
  Elmish.WPF -> C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF\bin\Release\net461\Elmish.WPF.dll
  Elmish.WPF -> C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF\bin\Release\netcoreapp3.0\Elmish.WPF.dll
  Successfully created package 'C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF\bin\Release\Elmish.WPF.3.5.5.nupkg'.
  UiBoundCmdParam -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\UiBoundCmdParam\bin\Release\netcoreapp3.0\UiBoundCmdParam.dll
  Validation -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\Validation\bin\Release\netcoreapp3.0\Validation.dll
  SubModelSeq -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModelSeq\bin\Release\netcoreapp3.0\SubModelSeq.dll
  EventBindingsAndBehaviors -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\EventBindingsAndBehaviors\bin\Release\netcoreapp3.0\EventBindingsAndBehaviors.dll
  OneWaySeq -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\OneWaySeq\bin\Release\netcoreapp3.0\OneWaySeq.dll
  FileDialogs.CmdMsg -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\FileDialogs.CmdMsg\bin\Release\netcoreapp3.0\FileDialogs.CmdMsg.dll
  FileDialogs -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\FileDialogs\bin\Release\netcoreapp3.0\FileDialogs.dll
  SingleCounter -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SingleCounter\bin\Release\netcoreapp3.0\SingleCounter.dll
  SubModel -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModel\bin\Release\netcoreapp3.0\SubModel.dll
  NewWindow -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\NewWindow\bin\Release\netcoreapp3.0\NewWindow.dll
  SubModelOpt -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModelOpt\bin\Release\netcoreapp3.0\SubModelOpt.dll
  SubModelSelectedItem -> C:\Code\ThirdParty\Elmish.WPF\src\Samples\SubModelSelectedItem\bin\Release\netcoreapp3.0\SubModelSelectedItem.dll
  Elmish.WPF.Tests -> C:\Code\ThirdParty\Elmish.WPF\src\Elmish.WPF.Tests\bin\Release\net461\Elmish.WPF.Tests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:39.93

@TysonMN
Copy link
Member Author

TysonMN commented Jun 30, 2020

Here are some minimal tests to help isolate the issue.

module TestNamespace.TestModule

open Hedgehog
open Xunit


[<Fact>]
let ``Passes: generate a bool`` () =
  Property.check <| property {
    let! _ = Gen.bool
    ()
  }

[<Fact>]
let ``Passes: create an exponential range`` () =
  let _ = Range.exponential 1 2
  ()

[<Fact>]
let ``Passes: generate bool list from a constant range`` () =
  Property.check <| property {
    let range = Range.constant 1 2
    let! _ = Gen.bool |> Gen.list range
    ()
  }

[<Fact>]
let ``Fails for some targets but passes for others: generate bool list from an exponential range`` () =
  Property.check <| property {
    let range = Range.exponential 1 50
    let! _ = Gen.bool |> Gen.list range
    ()
  }

The issue has something do with the function Range.exponential from Hedgehog.Experimental.

Hedgehog.Experimental targets .NET Standard 2.0. The documentation for .NET Standard lists .NET Framework as being compatible with .NET Standard 2.0, but then tempers that by saying

The versions listed here represent the rules that NuGet uses to determine whether a given .NET Standard library is applicable. While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.

It appears that a recent version of MSBuild (between 16.5.0 and 16.6.0) has introduced one such issue. This issue doesn't exist for me when targeting .NET Framework 4.7.2 (as well as 4.7.1 actually) as well as all versions of .NET Core that successfully compile.

2020-06-30_09-14-25_162_devenv
ZIP of solution containing these tests

@cmeeren
Copy link
Member

cmeeren commented Jun 30, 2020

Happy to see you're investigating. Unfortunately I have no chance to look into this or anything else this week.

TysonMN added a commit that referenced this issue Jun 30, 2020
…h_constant

Replaced calls to Range.exponential with Range.constant to avoid issue #237
@TysonMN
Copy link
Member Author

TysonMN commented Jul 1, 2020

Another difference between me and AppVeyor is the version of the Microsoft Build Engine.

  • AppVeyor: 16.5.0+d4cbfca49 for .NET Core
  • Local: 16.6.0+5ff7b0c9e for .NET Core

I don't know how to specify that the code be build with MSBuild 16.5. However, I do know how to pick the .NET Core SDK though, which has some effect on the version of MSBuild.

Furthermore, here are all the versions of .NET Core SDK 3.1. There are no versions between the two I tested.

@TysonMN
Copy link
Member Author

TysonMN commented Jul 1, 2020

PR #240 implemented an acceptable workaround of this issue, and now I am also satisfied with my investigation of it (which might be of help to others).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants