You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "Mariia Mykhailova (JIRA)" <ji...@apache.org> on 2016/01/14 20:59:39 UTC

[jira] [Commented] (REEF-1079) Fix TestNamedParameterWithAliasRoundTrip test failures

    [ https://issues.apache.org/jira/browse/REEF-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15098751#comment-15098751 ] 

Mariia Mykhailova commented on REEF-1079:
-----------------------------------------

The root cause is that all tests which use default class hierarchy with the same assemblies/parameter parsers set (in this case none) get the same instance of it, so modifications done by one test reflect in others. If we remove caching from {{O.A.R.Tang.Implementations.Tang.TangImpl#GetDefaultClassHierarchy}}, this is fixed (I've verified that this test passes when run in parallel with others). 

But without caching another test starts to fail (even when run on its own) 

{noformat}
Org.Apache.REEF.Tang.Tests.Configuration.TestConfiguration.TestDeserializedConfigMerge

Result Message:	
Org.Apache.REEF.Tang.Exceptions.BindException : Failed to process configuration tuple: [Org.Apache.REEF.Tang.Examples.Timer+Seconds, Org.Apache.REEF.Tang.Examples, Version=0.14.0.0, Culture=neutral, PublicKeyToken=c27bf5b2e9a7ddb9=2]
---- Org.Apache.REEF.Tang.Exceptions.NameResolutionException : Could not resolve Org.Apache.REEF.Tang.Examples.Timer+Seconds, Org.Apache.REEF.Tang.Examples, Version=0.14.0.0, Culture=neutral, PublicKeyToken=c27bf5b2e9a7ddb9.  Search ended at prefix Cannot resolve the name from the class hierarchy during de-serialization: Org.Apache.REEF.Tang.Examples.Timer+Seconds, Org.Apache.REEF.Tang.Examples, Version=0.14.0.0, Culture=neutral, PublicKeyToken=c27bf5b2e9a7ddb9. This can happen due to typos in class names that are passed as strings, or because Tang uses Assembly loader other than the one that generated the class reference ((make sure you use the full name of a class)
Result StackTrace:	
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(Exception exception, String message, Logger logger) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Utilities\Diagnostics\Exceptions.cs:line 57
   at Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(Exception exception, Logger logger) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Utilities\Diagnostics\Exceptions.cs:line 75
   at Org.Apache.REEF.Tang.Formats.ConfigurationFile.ProcessConfigData(IConfigurationBuilder conf, IList`1 settings, String language) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang\Formats\ConfigurationFile.cs:line 235
   at Org.Apache.REEF.Tang.Formats.AvroConfigurationSerializer.AddFromAvro(IConfigurationBuilder cb, AvroConfiguration avroConfiguration) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang\Formats\AvroConfigurationSerializer.cs:line 332
   at Org.Apache.REEF.Tang.Formats.AvroConfigurationSerializer.FromAvro(AvroConfiguration avroConfiguration, IClassHierarchy classHierarchy) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang\Formats\AvroConfigurationSerializer.cs:line 215
   at Org.Apache.REEF.Tang.Tests.Configuration.TestConfiguration.TestDeserializedConfigMerge() in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang.Tests\Configuration\TestConfiguration.cs:line 68
----- Inner Stack Trace -----
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(Exception exception, String message, Logger logger) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Utilities\Diagnostics\Exceptions.cs:line 57
   at Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(Exception exception, Logger logger) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Utilities\Diagnostics\Exceptions.cs:line 75
   at Org.Apache.REEF.Tang.Protobuf.ProtocolBufferClassHierarchy.GetNode(String fullName, String aliasLanguage) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang\Protobuf\ProtocolBufferClassHierarchy.cs:line 502
   at Org.Apache.REEF.Tang.Implementations.Configuration.ConfigurationBuilderImpl.Bind(String key, String value, String aliasLanguage) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang\Implementations\Configuration\ConfigurationBuilderImpl.cs:line 235
   at Org.Apache.REEF.Tang.Formats.ConfigurationFile.ProcessConfigData(IConfigurationBuilder conf, IList`1 settings, String language) in c:\incubator-reef\lang\cs\Org.Apache.REEF.Tang\Formats\ConfigurationFile.cs:line 229
{noformat}

I think it's dangerous to remove caching altogether, since there can be production code relying on this behavior. Maybe we should add a {{GetDefaultHierarchy(bool cache)}} method which will produce a new class hierarchy instance or a cached one based on parameter? This way the tests can use no-cache version, and production code can choose whichever behavior fits.

> Fix TestNamedParameterWithAliasRoundTrip test failures
> ------------------------------------------------------
>
>                 Key: REEF-1079
>                 URL: https://issues.apache.org/jira/browse/REEF-1079
>             Project: REEF
>          Issue Type: Bug
>            Reporter: Mariia Mykhailova
>            Assignee: Mariia Mykhailova
>
> The method {{ProtocolBufferClassHierarchy.SerializeNode}} iterates over all children of a node, serializing them one by one.
> {noformat}
> foreach (INode child in n.GetChildren())
> {
>     children.Add(SerializeNode(child));
> }
> {noformat}
> If the list of children is changed in a different thread, this code will throw {{System.InvalidOperationException : Collection was modified after the enumerator was instantiated.}}. We observe this in {{TestNamedParameterWithAliasRoundTrip}} test which passes when executed individually but fails when executed in parallel with other tests which don't do serialization, just use default {{ClassHierarchy}}.
> We need to fix the failures of this test.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)