Beispiel #1
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 /// <exception cref="System.IO.IOException"/>
 private void TestGetContainerStatus(Container container, int index, ContainerState
                                     state, string diagnostics, IList <int> exitStatuses)
 {
     while (true)
     {
         try
         {
             ContainerStatus status = nmClient.GetContainerStatus(container.GetId(), container
                                                                  .GetNodeId());
             // NodeManager may still need some time to get the stable
             // container status
             if (status.GetState() == state)
             {
                 NUnit.Framework.Assert.AreEqual(container.GetId(), status.GetContainerId());
                 NUnit.Framework.Assert.IsTrue(string.Empty + index + ": " + status.GetDiagnostics
                                                   (), status.GetDiagnostics().Contains(diagnostics));
                 NUnit.Framework.Assert.IsTrue("Exit Statuses are supposed to be in: " + exitStatuses
                                               + ", but the actual exit status code is: " + status.GetExitStatus(), exitStatuses
                                               .Contains(status.GetExitStatus()));
                 break;
             }
             Sharpen.Thread.Sleep(100);
         }
         catch (Exception e)
         {
             Sharpen.Runtime.PrintStackTrace(e);
         }
     }
 }