Skip to content

`ProjectBuildTest` unit tests unstable on Linux

I still have the problem mentioned in #381 (comment 428586415) on unit tests:

  • TwoDifferentReferencesSpecifiedTest
  • TwoEqualReferencesDefaultTest
  • TwoEqualReferencesSpecifiedTest

on 8445319a.

$ dotnet build -c NetCore
$ dotnet vstest bin/Release/OpenTap.Package.UnitTests.dll 
--logger:"console;verbosity=detailed" 
--TestCaseFilter:FullyQualifiedName~TwoDifferentReferencesSpecifiedTest
$ grep "has already been added" 
/tmp/c4de4808-2701-4e55-b1c3-24e2c001e240/bin/SessionLogs/*
/tmp/c4de4808-2701-4e55-b1c3-24e2c001e240/bin/SessionLogs/SessionLog 
2020-10-14 15-20-38.txt:2020-10-14 15:20:39.619242 ; PluginManager  ; 
Error       ; Unable to load type 
'OpenTap.Package.FileRepositoryPackageDefSource' from 
'/tmp/c4de4808-2701-4e55-b1c3-24e2c001e240/bin/OpenTap.Package.dll'. 
Reason: 'An item with the same key has already been added.'.
/tmp/c4de4808-2701-4e55-b1c3-24e2c001e240/bin/SessionLogs/SessionLog 
2020-10-14 15-20-38.txt:2020-10-14 15:20:39.620929 ; PluginManager  ; 
Debug       ; Exception: An item with the same key has already been added.

The problem seems to be caused by ProjectBuildTest.CreateOpenTapInstall that installs an (unpatched) OpenTAP package from https://packages.opentap.io.

Check SessionLog_2020-10-14_15-20-38.txt:

2020-10-14 15:20:39.346047 ; Session        ; Debug       ; OpenTAP Engine 9.9.3+2fa91315 X64
Edited by Giulio Galante