Repository: reef Updated Branches: refs/heads/master 1cd8a09d3 -> d9c06e882
[REEF-1185] Fix CanRunClrBridgeExampleOnLocalRuntime test This addressed the issue by * Fixing concurrency issues in TestBridgeClient * Fixing null reference in HelloTaskCompletedHandler * Disposing completed task's active context in HelloTaskCompletedHandler JIRA: [REEF-1185](https://issues.apache.org/jira/browse/REEF-1185) Pull Request: Closes #838 Project: http://git-wip-us.apache.org/repos/asf/reef/repo Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/d9c06e88 Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/d9c06e88 Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/d9c06e88 Branch: refs/heads/master Commit: d9c06e882cac06aa19416f79d6949ff83f43a9fa Parents: 1cd8a09 Author: Anupam <[email protected]> Authored: Wed Feb 10 16:28:50 2016 -0800 Committer: Andrew Chung <[email protected]> Committed: Thu Feb 11 12:07:54 2016 -0800 ---------------------------------------------------------------------- .../HelloTaskCompletedHandler.cs | 5 ++++- .../Functional/Bridge/TestBridgeClient.cs | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/reef/blob/d9c06e88/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloTaskCompletedHandler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloTaskCompletedHandler.cs b/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloTaskCompletedHandler.cs index 9214543..9222cf1 100644 --- a/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloTaskCompletedHandler.cs +++ b/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloTaskCompletedHandler.cs @@ -38,7 +38,10 @@ namespace Org.Apache.REEF.Examples.AllHandlers /// <param name="completedTask"></param> public void OnNext(ICompletedTask completedTask) { - Console.WriteLine("Received CompletedTask: {0}, with message [{1}].", completedTask.Id, ByteUtilities.ByteArraysToString(completedTask.Message)); + Console.WriteLine("Received CompletedTask: {0}", completedTask.Id); + using (completedTask.ActiveContext) + { + } } public void OnError(Exception error) http://git-wip-us.apache.org/repos/asf/reef/blob/d9c06e88/lang/cs/Org.Apache.REEF.Tests/Functional/Bridge/TestBridgeClient.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tests/Functional/Bridge/TestBridgeClient.cs b/lang/cs/Org.Apache.REEF.Tests/Functional/Bridge/TestBridgeClient.cs index 1bf431f..44c1ea9 100644 --- a/lang/cs/Org.Apache.REEF.Tests/Functional/Bridge/TestBridgeClient.cs +++ b/lang/cs/Org.Apache.REEF.Tests/Functional/Bridge/TestBridgeClient.cs @@ -16,6 +16,7 @@ // under the License. using System; +using System.Threading.Tasks; using Org.Apache.REEF.Client.Common; using Org.Apache.REEF.Examples.AllHandlers; using Org.Apache.REEF.Utilities.Logging; @@ -37,27 +38,27 @@ namespace Org.Apache.REEF.Tests.Functional.Bridge [Trait("Priority", "1")] [Trait("Category", "FunctionalGated")] [Trait("Description", "Run CLR Bridge on Yarn")] - public void CanRunClrBridgeExampleOnYarn() + public async Task CanRunClrBridgeExampleOnYarn() { string testRuntimeFolder = DefaultRuntimeFolder + TestNumber++; - RunClrBridgeClient(true, testRuntimeFolder); + await RunClrBridgeClient(true, testRuntimeFolder); } - [Fact(Skip = "Test broken, ignoring to unblock xUnit migration. TODO[JIRA REEF-1185]")] + [Fact] [Trait("Priority", "1")] [Trait("Category", "FunctionalGated")] [Trait("Description", "Run CLR Bridge on local runtime")] //// TODO[JIRA REEF-1184]: add timeout 180 sec - public void CanRunClrBridgeExampleOnLocalRuntime() + public async Task CanRunClrBridgeExampleOnLocalRuntime() { string testRuntimeFolder = DefaultRuntimeFolder + TestNumber++; CleanUp(testRuntimeFolder); - RunClrBridgeClient(false, testRuntimeFolder); + await RunClrBridgeClient(false, testRuntimeFolder); } - private async void RunClrBridgeClient(bool runOnYarn, string testRuntimeFolder) + private async Task RunClrBridgeClient(bool runOnYarn, string testRuntimeFolder) { - string[] a = new[] { runOnYarn ? "yarn" : "local", testRuntimeFolder }; + string[] a = { runOnYarn ? "yarn" : "local", testRuntimeFolder }; IJobSubmissionResult driverHttpEndpoint = AllHandlers.Run(a); var uri = driverHttpEndpoint.DriverUrl + "NRT/status?a=1&b=2";
