no message
This commit is contained in:
6
.idea/workspace.xml
generated
6
.idea/workspace.xml
generated
@@ -8,6 +8,12 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Global.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/ProjectData/Messages/Message.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ProjectData/Messages/Message.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPlanner.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/MachineQueueSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/MachineQueueSupervisor.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"PerformanceAnalyzerPath": "",
|
||||
"ComponentsBackUpsCount": 10,
|
||||
"TestingKernels": 28,
|
||||
"AutoCheckTesting": true,
|
||||
"AutoCheckTesting": false,
|
||||
"CheckTestingIntervalSeconds": 10,
|
||||
"EmailOnTestingProgress": false,
|
||||
"eraseTestingWorkspaces": true
|
||||
|
||||
@@ -77,6 +77,7 @@ public class Global {
|
||||
public static File DVMPackagesDirectory;
|
||||
public static File SapforsDirectory;
|
||||
public static File SapforPackagesDirectory;
|
||||
public static File MachinesDirectory;
|
||||
//------------------------------------------------------------------
|
||||
public static Visualiser visualiser = null;
|
||||
public static Visualizer_2 visualizer_2 = null;
|
||||
@@ -137,6 +138,7 @@ public class Global {
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = Paths.get(Home, DVMPackages).toFile());
|
||||
Utils.CheckDirectory(SapforsDirectory = Paths.get(Home, "Sapfors").toFile());
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = Paths.get(Home, "SapforPackages").toFile());
|
||||
Utils.CheckDirectory(MachinesDirectory = Paths.get(Home, "Machines").toFile());
|
||||
}
|
||||
public static void CreateLogAtComponentsPath() {
|
||||
Log = new Loggable() {
|
||||
@@ -406,7 +408,7 @@ public class Global {
|
||||
break;
|
||||
case MachineQueue:
|
||||
MachineQueueSupervisor supervisor = new MachineQueueSupervisor(args);
|
||||
while (true){
|
||||
while (true) {
|
||||
supervisor.Perform();
|
||||
}
|
||||
case Undefined:
|
||||
|
||||
@@ -55,6 +55,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
||||
//-
|
||||
setPreferredSize(new Dimension(0, 30));
|
||||
//---
|
||||
/*
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/Apply.png");
|
||||
@@ -64,6 +65,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
||||
});
|
||||
}
|
||||
});
|
||||
*/
|
||||
ShowProject(false);
|
||||
}
|
||||
public void ShowUpdatesIcon() {
|
||||
|
||||
@@ -268,15 +268,15 @@ public class Message extends FileObject {
|
||||
codedMessages.put("R191", "Приватная переменная '%s' была удалена");
|
||||
codedMessages.put("R201", "Приватная переменная '%s' была частично удалена");
|
||||
//2019
|
||||
codedMessages.put("R192", "Нельзя удалить приватную переменную '%s' - она не имеет фиксированных измерений");
|
||||
codedMessages.put("R192", "Удаление приватной переменной '%s' было выполнено в предположении, что выражения '%s' и '%s' различны");
|
||||
//2020
|
||||
codedMessages.put("R193", "Нельзя удалить приватную переменную '%s' - более одного определения достигают оператора");
|
||||
codedMessages.put("R193", "");
|
||||
codedMessages.put("R194", "Нельзя удалить приватную переменную '%s' - не удалось найти достигающее определение для оператора");
|
||||
//2022
|
||||
codedMessages.put("R196", "Невозможно выполнить преобразование циклов из-за зависимостей между операторами.");
|
||||
//2023
|
||||
codedMessages.put("R197", "Преобразование не может быть выполнено - не произошло никаких изменений в коде");
|
||||
codedMessages.put("R198", "Цикл на строке %d был удалён");
|
||||
codedMessages.put("R198", "Нельзя удалить приватную переменную '%s' - обращения к ней имеют разное выравнивание с циклом");
|
||||
codedMessages.put("R199", "Зависимость по скаляру с типом lastprivate препятствует распараллеливанию данного цикла");
|
||||
codedMessages.put("R200", "Добавлена lastprivate переменная '%s' к циклу на строке %d");
|
||||
codedMessages.put("R202", "Ссылка '%s' имеет отличный от оригинального массива размер");
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||
@Override
|
||||
public void GetVersionInfo() {
|
||||
version = 1096;
|
||||
version = 1097;
|
||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||
date_text = df.format(getClassBuildTime());
|
||||
|
||||
@@ -32,7 +32,9 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
target = response.object;
|
||||
}
|
||||
};
|
||||
if (!pass.Do()) throw new PassException("Ошибка взаимодействия с сервером " + code_in);
|
||||
if (!pass.Do()) {
|
||||
ServerConnectionError(code_in);
|
||||
}
|
||||
return pass.target;
|
||||
}
|
||||
protected Object ServerCommand(ServerCode code_in, Serializable object_in) throws Exception {
|
||||
@@ -103,8 +105,38 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
}
|
||||
protected void Disconnect() {
|
||||
}
|
||||
//жизненный цикл планировщика
|
||||
protected void Session() throws Exception {
|
||||
protected void MachineConnectionError(){
|
||||
}
|
||||
protected void ServerConnectionError(ServerCode code_in) throws Exception{
|
||||
throw new PassException("Ошибка взаимодействия с сервером " + code_in);
|
||||
}
|
||||
// ---
|
||||
protected void PerformPackage(TestingPackage package_in) throws Exception{
|
||||
testingPackage = (P) package_in;
|
||||
//--
|
||||
Print(testingPackage.id + ":" + testingPackage.state.getDescription());
|
||||
//--
|
||||
if (testingPackage.connectionErrosCount>=10){
|
||||
Print(testingPackage.id+" had 10 connection errors. stop");
|
||||
UpdatePackageState(TasksPackageState.ConnectionError);
|
||||
MachineConnectionError();
|
||||
}else {
|
||||
//--
|
||||
InitSessionCredentials();
|
||||
if (testingPackage.state.equals(TasksPackageState.Analysis)) {
|
||||
AnalyseResults();
|
||||
UpdatePackageState(TasksPackageState.Done);
|
||||
} else {
|
||||
try {
|
||||
if (Connect()) {
|
||||
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
|
||||
if (ptk_id != Constants.Nan) {
|
||||
Print("package " + testingPackage.id + " NEEDS TO KILL");
|
||||
Kill();
|
||||
UpdatePackageState(TasksPackageState.Aborted);
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
|
||||
} else {
|
||||
//--
|
||||
switch (testingPackage.state) {
|
||||
case TestsSynchronize:
|
||||
TestsSynchronize();
|
||||
@@ -127,33 +159,7 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
if (CheckNextState()) UpdatePackage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// ---
|
||||
protected void PerformPackage(TestingPackage package_in) throws Exception{
|
||||
testingPackage = (P) package_in;
|
||||
//--
|
||||
Print(testingPackage.id + ":" + testingPackage.state.getDescription());
|
||||
//--
|
||||
if (testingPackage.connectionErrosCount>=10){
|
||||
Print(testingPackage.id+" had 10 connection errors. stop");
|
||||
UpdatePackageState(TasksPackageState.ConnectionError);
|
||||
}else {
|
||||
//--
|
||||
InitSessionCredentials();
|
||||
if (testingPackage.state.equals(TasksPackageState.Analysis)) {
|
||||
AnalyseResults();
|
||||
UpdatePackageState(TasksPackageState.Done);
|
||||
} else {
|
||||
try {
|
||||
if (Connect()) {
|
||||
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
|
||||
if (ptk_id != Constants.Nan) {
|
||||
Print("package " + testingPackage.id + " NEEDS TO KILL");
|
||||
Kill();
|
||||
UpdatePackageState(TasksPackageState.Aborted);
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
|
||||
} else {
|
||||
Session();
|
||||
}
|
||||
} else {
|
||||
testingPackage.connectionErrosCount++;
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
public class MachineQueueSupervisor extends TestingPlanner<DVMPackage> {
|
||||
File supervisorHome = null;
|
||||
Machine machine = null;
|
||||
User user = null;
|
||||
boolean local;
|
||||
@@ -44,12 +45,12 @@ public class MachineQueueSupervisor extends TestingPlanner<DVMPackage> {
|
||||
String userPassword = args[3];
|
||||
String userWorkspace = args[4];
|
||||
String testingSystemRoot = args[5];
|
||||
String supervisorHome = Global.Home; //при инициализации это текущая папка.
|
||||
supervisorHome = new File(Global.Home); //при инициализации это текущая папка.
|
||||
//---
|
||||
Global.Log = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return supervisorHome;
|
||||
return supervisorHome.getAbsolutePath();
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
@@ -114,6 +115,25 @@ public class MachineQueueSupervisor extends TestingPlanner<DVMPackage> {
|
||||
Print("Соединение c " + machine.getURL() + " " + user.login + " сброшено.");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void Print(String message) {
|
||||
try {
|
||||
if (isPrintOn()) {
|
||||
Global.Log.Print(message);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
void Finalize(String reason){
|
||||
File stateFile = new File(supervisorHome, Constants.ABORTED);
|
||||
try {
|
||||
FileUtils.writeStringToFile(stateFile, reason);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
//--
|
||||
//Получить ид тестов и их папки на сервере.
|
||||
LinkedHashMap<Integer, File> getTestsFromJson() {
|
||||
@@ -365,7 +385,7 @@ public class MachineQueueSupervisor extends TestingPlanner<DVMPackage> {
|
||||
Print("PID not found");
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
testingPackage.PID = user.connection.readFromFile(PID).replace("\n","").replace("\r","");
|
||||
testingPackage.PID = user.connection.readFromFile(PID).replace("\n", "").replace("\r", "");
|
||||
//---
|
||||
System.out.println("PID=" + Utils.Brackets(testingPackage.PID));
|
||||
RemoteFile STARTED = new RemoteFile(packageRemoteWorkspace, "STARTED");
|
||||
@@ -426,6 +446,15 @@ public class MachineQueueSupervisor extends TestingPlanner<DVMPackage> {
|
||||
// user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
||||
}
|
||||
@Override
|
||||
protected void MachineConnectionError() {
|
||||
Finalize("Количество безуспешных попыток соединения с машиной " +machine.getURL()+
|
||||
" превысило 10");
|
||||
}
|
||||
@Override
|
||||
protected void ServerConnectionError(ServerCode code_in) throws Exception {
|
||||
Finalize("Не удалось выполнить команду " + code_in+ " на сервере тестирования");
|
||||
}
|
||||
@Override
|
||||
protected void Kill() throws Exception {
|
||||
if (!testingPackage.PID.isEmpty()) {
|
||||
user.connection.Command("kill -9 " + testingPackage.PID);
|
||||
|
||||
Reference in New Issue
Block a user