public void JS_PTI_BasicEndToEnd_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 2; long totalBytes = 2147483648; long totalEchoBytes = 2147483648; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 49152; bool bidi = true; string logTriggerSize = "1024"; // just set a test to have 1024 which is the default of C# string originaltestName = "jsptibidiendtoendtest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_logTriggerSizeinMB, logTriggerSize); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_BasicTwoProc_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string originaltestName = "jsptitwoproctestbidi"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it int numRounds = 3; long totalBytes = 3221225472; long totalEchoBytes = 3221225472; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 114688; bool bidi = true; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 15, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify the data in the output file of the CLIENT pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 5, true, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying server and client side of things (do both since bidi) JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicRestartTwoProc_PostMeth_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 3; long totalBytes = 3221225472; long totalEchoBytes = 3221225472; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; bool bidi = false; string originaltestName = "jsptirestartpostmeth"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; string logOutputClientRestartedFileName_TestApp = testName + "Client_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Start it once - Launch the client and the server as separate procs //*** NOTE - The first call (Server in this case) starts 4 nodes and sometimes it doesn't give proper process id //*** However, the second call only starts one node, so make sure client is second so then know that PID is correct for killing it int serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole, "", true); int clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName, true); // Give it 20 seconds where it tries to connect but doesn't MyUtils.TestDelay(20000); // Kill client MyUtils.KillProcess(clientProcessID); // Restart the client and make sure it continues clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "All rounds complete", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); // Verify the Post Method messages pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "Restarted result timeouts for", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (114688)", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_RestartTwoProcKillClient_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 10; long totalBytes = 163840; long totalEchoBytes = 163840; int bytesPerRound = 16384; int maxMessageSize = 64; int batchSizeCutoff = 16384; int messagesSent = 2560; bool bidi = false; string testName = "jsptirestartkillclient"; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; string logOutputClientRestartedFileName_TestApp = testName + "Client_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Start it once - Launch the client and the server as separate procs //*** NOTE - The first call (Server in this case) starts 4 nodes and sometimes it doesn't give proper process id //*** However, the second call only starts one node, so make sure client is second so then know that PID is correct for killing it int serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); int clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Give it 5 seconds where it tries to connect but doesn't MyUtils.TestDelay(5000); // Kill client MyUtils.KillProcess(clientProcessID); // Restart the client and make sure it continues clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_RestartTwoProcKillClient_Test> Echoed string should NOT have been found in the output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicRestartEndToEnd_PostMeth_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 3; long totalBytes = 3221225472; long totalEchoBytes = 3221225472; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; bool bidi = false; string originaltestName = "jsptirestartendtoendpostmeth"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; string logOutputFileName_TTDVerify = testName + "__VerifyTTD_1.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp, 0, false, "", "", true); // Give it 20 seconds where it tries to connect but doesn't MyUtils.TestDelay(20000); // Kill it MyUtils.StopAllAmbrosiaProcesses(); // Restart it and make sure it continues JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp, 0, false, "", "", true); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify the Post Method messages pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Restarted result timeouts for", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "outgoing messages and 128 in-flight post methods...", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Outgoing message queue is empty; there are no in-flight post methods", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (114688)", 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "outgoing messages and 128 in-flight post methods...", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "Outgoing message queue is empty; there are no in-flight post methods", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (114688)", 1, false, testName, true); }
public void JS_PTI_BasicRestartEndToEnd_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 20; long totalBytes = 327680; long totalEchoBytes = 327680; int bytesPerRound = 16384; int maxMessageSize = 64; int batchSizeCutoff = 16384; int messagesSent = 5120; bool bidi = false; string originaltestName = "jsptirestartendtoendtest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Give it 2 seconds where it tries to connect but doesn't MyUtils.TestDelay(2000); // Kill it MyUtils.StopAllAmbrosiaProcesses(); // Restart it and make sure it continues JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_BasicEndToEnd_Test> Echoed string should NOT have been found in the output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_RestartTwoProcKillBoth_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 3; long totalBytes = 3221225472; long totalEchoBytes = 3221225472; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; bool bidi = true; string testName = "jsptirestartkillbothbidi"; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; string logOutputClientRestartedFileName_TestApp = testName + "Client_TestApp_Restarted.log"; string logOutputServerRestartedFileName_TestApp = testName + "Server_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Start it once - Launch the client and the server as separate procs int clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); int serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); // Give it 5 seconds where it tries to connect but doesn't MyUtils.TestDelay(5000); // Kill server and client MyUtils.StopAllAmbrosiaProcesses(); // Restart the server and client and make sure it continues serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputServerRestartedFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputServerRestartedFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true, false); // Verify that echo is part of the output pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "All rounds complete", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicTwoProc_PostMeth_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string originaltestName = "jsptitwoprocpostmeth"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 245760; bool bidi = false; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole, "", true); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName, true); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify the data in the output file of the CLIENT - since not bidi, no echoed bytes // Verify that echo is NOT part of the output for client pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); // Verify the Post Method messages pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (245760)", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying server side of things (not bidi so only do Server which will not show Post Meth) JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicRestartEndToEnd_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; bool bidi = true; string originaltestName = "jsptirestartendtoendbiditest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Give it 10 seconds to do something before killing it MyUtils.TestDelay(10000); // Kill it MyUtils.StopAllAmbrosiaProcesses(); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_autoRegister, "false"); // get auto changed to false but ok to specifically state in case default changes // Restart it and make sure it continues JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 15, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "All rounds complete", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_BasicEndToEnd_PostMeth_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 245760; bool bidi = false; string logTriggerSize = "256"; string originaltestName = "jsptiendtoendtestpostmeth"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileName_TTDVerify = testName + "__VerifyTTD_1.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_logTriggerSizeinMB, logTriggerSize); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp, 0, false, "", "", true); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify the Post Method messages pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "outgoing messages and 768 in-flight post methods...", 1, false, testName, true); // The "Waiting for xxx number changes from run to run pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Outgoing message queue is empty; there are no in-flight post methods", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (245760)", 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "outgoing messages and 768 in-flight post methods...", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "Outgoing message queue is empty; there are no in-flight post methods", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (245760)", 1, false, testName, true); }
public void JS_PTI_RestartAfterFinishes_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 5; long totalBytes = 640; long totalEchoBytes = 640; int bytesPerRound = 128; int maxMessageSize = 64; int batchSizeCutoff = 32; int messagesSent = 10; bool bidi = true; string testName = "jsptirestartafterfinishesbiditest"; string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Wait until it finishes bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed // Restart it and make sure it runs ok JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp); // Verify the data in the restarted output file pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Checkpoint loaded", 1, false, testName, true); // since it is restarted, it loads the check point pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_BlobClientFile_TwoProc_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string testName = "jsptiblobclientfiletwoproctest"; int numRounds = 4; long totalBytes = 16384; long totalEchoBytes = 16384; int bytesPerRound = 4096; int maxMessageSize = 256; int batchSizeCutoff = 256; int messagesSent = 176; bool bidi = false; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, "", JSUtils.JSPTI_ClientInstanceRole); // JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs, JSUtils.JSPTI_ServerInstanceRole); // Keep Server as a File // JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, "", JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "logStorageType=Files", 1, false, testName, true); // Verify the data in the output file of the CLIENT - since not bidi, no echoed bytes // Verify that echo is NOT part of the output for client pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_BlobClientFile_BasicTwoProc_Test> Echoed string should NOT have been found in the CLIENT output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "logStorageType=Blobs", 1, false, testName, true, false); // Verify that directory does not exist to show it wasn't in a file as not real easy ways to verify blob string logDirectory = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaLogDirectory"]; string expectedClientLogFile = logDirectory + "\\" + testName + "client_0"; if (Directory.Exists(expectedClientLogFile)) { Assert.Fail("<JS_PTI_BlobClientFile_BasicTwoProc_Test> - Directory:" + expectedClientLogFile + " was found when it shouldn't have been."); } string expectedServerLogFile = logDirectory + "\\" + testName + "server_0"; if (Directory.Exists(expectedServerLogFile) == false) { Assert.Fail("<JS_PTI_BlobClientFile_BasicTwoProc_Test> - Directory:" + expectedServerLogFile + " was NOT found."); } // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }