Test task scheduling method and device, storage medium and program product
By disassembling the test tasks into multiple subtasks in the distributed scheduling system and scheduling in parallel, the problem of inefficiency in the traditional test task scheduling method is solved, and efficient test tasks execution and resource utilization are achieved.
Patent Information
- Application Number
- CN202510764177.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-09
AI Technical Summary
Traditional test task scheduling methods are difficult to meet the execution efficiency requirements of high concurrency and large-scale test tasks, especially in the software development process, and it is difficult for the existing technology to efficiently schedule and execute a large number of test tasks.
By disassembling the test tasks into multiple subtasks and allocating the task allocation nodes to multiple scheduling nodes for parallel resource scheduling, a distributed scheduling system is used to realize one-stop scheduling of test tasks, ensuring that each subtask is self-contained and reducing cross-task dependencies.
The execution efficiency of concurrent testing tasks is improved. Through parallel resource scheduling and task splitting, resource waste and task waiting time are reduced, and overall resource utilization and test tasks are improved.
Smart Images

Figure CN120277001A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technologies, and in particular, to a testing task scheduling method, device, storage medium, and program product. Background Art
[0002] With the rapid development of information technology, the complexity and scale of software systems are also increasing. This change not only places higher requirements on the software development process but also significantly increases the difficulty of software quality assurance work. As one of the key links in the software development life cycle, software testing has also seen a substantial increase in the volume of testing tasks. However, traditional testing task scheduling methods often rely on polling and synchronous waiting, making it difficult to meet the execution efficiency requirements of current high-concurrency and large-scale testing tasks. Summary of the Invention
[0003] Embodiments of this application provide a testing task scheduling method, device, storage medium, and program product to improve the execution efficiency of concurrent testing tasks.
[0004] Embodiments of this application provide a testing task scheduling method applicable to any scheduling node in a distributed scheduling system. The method includes: Obtain a testing task; According to the configuration information of the testing task, disassemble the testing task into multiple subtasks; Send the multiple subtasks to a task allocation node for the task allocation node to allocate the multiple subtasks to multiple scheduling nodes for parallel resource scheduling.
[0005] Optionally, the method further includes: For at least one target subtask obtained, obtain the resource allocation policy and resource specification information corresponding to the target testing task from the configuration information of the target testing task to which the at least one target subtask belongs; According to the resource allocation policy and resource specification information corresponding to the target testing task, allocate resources to the at least one target subtask to obtain the resource allocation information of the at least one target subtask; According to the resource allocation information of the target testing task and the task priority in the configuration information of the target testing task, schedule the at least one target subtask to the resources allocated to each of the at least one target subtasks to execute the test cases corresponding to each of the at least one target subtasks by using the resources allocated to each of the at least one target subtasks.
[0006] Embodiments of this application also provide an electronic device, a distributed scheduling system, including: multiple scheduling nodes and a task allocation node; The multiple scheduling nodes are used to execute the steps in the above-mentioned test task scheduling method; The task assignment node is used to assign the multiple subtasks obtained by disassembling the test task to the multiple scheduling nodes; The multiple scheduling nodes are further used to perform parallel resource scheduling on the multiple subtasks.
[0007] An embodiment of the present application further provides an electronic device, including: a memory and a processor; wherein, the memory is used to store a computer program; The processor is coupled to the memory and is used to execute the computer program to execute the steps in the above-mentioned test task scheduling method.
[0008] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to execute the steps in the above-mentioned test task scheduling method.
[0009] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed by one or more processors, causes the one or more processors to execute the steps in the above-mentioned test task scheduling method.
[0010] In the embodiment of the present application, the test task is disassembled into multiple subtasks through task disassembly, and the task assignment node assigns the multiple subtasks to multiple scheduling nodes, so that the multiple scheduling nodes can perform parallel resource scheduling on the multiple subtasks, realizing one-stop scheduling of the test task. In this embodiment, the test task is disassembled into multiple subtasks, and the multiple scheduling nodes perform parallel resource scheduling on the multiple subtasks. Compared with parallel processing of multiple test tasks, parallel processing of the subtasks of the test task can improve the concurrent processing ability and help improve the execution efficiency of concurrent test tasks. On the other hand, since the configuration information of the test task includes the parameters and conditions set for the test task to be successfully executed, therefore, based on the configuration information of the test task for task disassembly, it can ensure that each subtask is self-contained and reduce cross-task dependencies. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings: Figure 1 is a schematic structural diagram of a distributed scheduling system provided by an embodiment of the present application; Figure 2 is a schematic diagram of a test task creation method provided by an embodiment of the present application; Figure 3Schematic diagram of the task scheduling process provided by the embodiments of the present application; Figure 4 Schematic diagram of the principle of disassembling test tasks provided by the embodiments of the present application; Figure 5 Schematic diagram of the chain provided by the embodiments of the present application; Figure 6 Schematic diagram of the data structure of subtasks provided by the embodiments of the present application; Figure 7 Schematic diagram of test tasks from the user's perspective provided by the embodiments of the present application; Figure 8 Schematic diagram of test tasks from the perspective of the scheduling node provided by the embodiments of the present application; Figure 9 Schematic diagram of the exception handling process provided by the embodiments of the present application; Figure 10 Schematic diagram of the task processing process of the anti-"starvation" mechanism provided by the embodiments of the present application; Figure 11 Schematic diagram of the flow of the test task scheduling method provided by the embodiments of the present application; Figure 12 Schematic diagram of the structure of the scheduling device provided by the embodiments of the present application; Figure 13 Schematic diagram of the structure of the electronic device provided by the embodiments of the present application. Detailed implementation manners
[0012] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0013] It should be noted that in the case where the embodiments of the present application involve user information, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0014] The following explains the terms or concepts involved in the embodiments of the present application.
[0015] Test task (job): An execution unit that contains one or more test cases and a series of test operations performed in a specific test environment.
[0016] Task decomposition: Splitting one or more test tasks into subtasks that are easier to schedule and execute.
[0017] Subtask (subjob): A sub-execution task split from a test task.
[0018] Resource allocation: Allocating specified resources such as machines or virtual instances for test tasks.
[0019] Kafka: An open-source distributed stream processing platform widely used for real-time data stream transmission and processing.
[0020] Redis: An open-source, in-memory data structure store commonly used as a database, cache, and message broker.
[0021] Test suite: A set of test cases that are executed together to test specific functions or features of software.
[0022] Test case: An independent test instance designed to verify a specific function of a software system or its components.
[0023] Distributed scheduling engine (runner): A system used to manage and coordinate tasks or jobs executed on multiple computing nodes.
[0024] Execution step: A detailed execution step split from one or more subtasks, and each step is an independently executable script.
[0025] To improve the execution efficiency of concurrent test tasks, in some embodiments of the present application, the test task is disassembled into multiple subtasks through task decomposition, and the task allocation node allocates the multiple subtasks to multiple scheduling nodes, so that the multiple scheduling nodes can perform parallel resource scheduling on the multiple subtasks, realizing one-stop scheduling of the test task. In this embodiment, the test task is split into multiple subtasks, and the multiple scheduling nodes perform parallel resource scheduling on the multiple subtasks. Compared with parallel processing of multiple test tasks, parallel processing of the subtasks of the test task can improve the concurrent processing ability and help improve the execution efficiency of concurrent test tasks. On the other hand, since the configuration information of the test task contains the parameters and conditions set for the smooth execution of the test task, therefore, task decomposition based on the configuration information of the test task can ensure that each subtask is self-contained and reduce cross-task dependencies.
[0026] The following will describe in detail the technical solutions provided by each embodiment of the present application with reference to the accompanying drawings.
[0027] It should be noted that the same reference numerals represent the same object or the same step in the following drawings and embodiments. Therefore, once an object or a step is defined in one drawing or embodiment, it does not need to be further discussed in subsequent drawings and embodiments.
[0028] Figure 1 This is a schematic structural diagram of the distributed scheduling system provided by the embodiment of the present application. As Figure 1 shown, the distributed scheduling system includes: a test platform 10, a plurality of scheduling nodes 20, and a task allocation node 30. In various embodiments of the present application, "a plurality of" means two or more (including two).
[0029] In this embodiment, the test platform 10 refers to a node or device that interacts with the user and is used to provide a test task creation interface for the user to create a test task through the interaction interface. As Figure 2 shown, the test platform supports single-task creation and multi-task creation. In some embodiments, as Figure 2 shown in "Web page", the test task creation interface provided by the test platform 10 can be implemented as a World Wide Web (Web) page. The Web page may include various configuration item controls, and the user can configure the configuration information of the test task through various configuration item controls. "Various" means two or more (including two). Among them, the configuration information of the test task refers to the parameters and conditions set before the execution of the test task to ensure the smooth execution of the test task, and may include: some or all of the identifier of the test suite of the test task, the configuration information of the test suite, the environment configuration information, the task priority, etc., but not limited thereto.
[0030] Among them, the configuration information of the test suite refers to the parameters or conditions set for the smooth execution of the test cases included in the test suite, and may include: the resource allocation strategy corresponding to the test suite and the resource specification information, etc., but not limited thereto. The resource allocation strategy refers to the strategy for allocating corresponding resources to the test suite. The specific resource allocation strategy will be described in the following embodiments and will not be elaborated here. The resource specification information refers to the resource requirement information of the test suite, which can be used to specify the resource size required by the test suite, and may include: the number of processor cores, the memory size, the bandwidth size, etc. The resource specification information may also include the attribute requirements for the physical machine where the resources are located, such as the model and architecture.
[0031] The environment configuration information refers to the environment in which the test task will run, and may include: some or all of whether to start the kernel, whether to restart the virtual instance or the physical machine, the global variables of the test task, and the package management tool (Package Manager, PM).
[0032] The user can configure the configuration information of the test task through various configuration item controls on the Web page, and the test platform 10 can obtain the configuration information of the test task; and create a test task according to the configuration information of the test task. For the method of creating a test task through the Web page, such as Figure 2 shown, it can be divided into creating by the type of test task and creating by the template of the test task. Creating by the type of test task means that multiple test task types are preset in advance, and different test task types correspond to different configuration item controls. By the user selecting the test task type, the corresponding configuration item controls for the test task type are provided to the user. Creating by the template of the test task means providing the template of the test task to the user, and the user can modify it on the template to create a test task, etc.
[0033] In some other embodiments, the test platform 10 can provide an Application Programming Interface (API). Such as Figure 2 shown in "API Creation", the user can call the corresponding API through their terminal device to provide the configuration information of the test task to the test platform 10. The test platform 10 can obtain the configuration information of the test task; and create a test task according to the configuration information of the test task. Among them, the test task can be one or more. Or, the test platform 10 can also call the corresponding API through its terminal device to provide a test plan to the test platform 10. A test plan is a set of pre-arranged test work, including test task creation, test task execution, etc. Correspondingly, such as Figure 2 shown in "Test Plan Creation", the test platform 10 can create test tasks according to the test plan. The test tasks created according to the test plan can be one or more. According to the above method, the test platform 10 can complete the creation of test tasks, corresponding to Figure 1 and Figure 3 "Test Task Creation" in Step 1.
[0034] Furthermore, such as Figure 3 shown in Step 2 "Storage", the test platform 10 can store the information of the test task in the database 40. Among them, the information of the test task refers to the information describing the test task, and can include: the name, identifier, and configuration information of the test task, etc. Correspondingly, such as Figure 1 and Figure 3As shown, the test platform 10 can also provide information about the test task to the scheduling node 20. The scheduling node 20 refers to the node that schedules the test task. The scheduling node 20 can be a single server device, a cloudified server array, or a virtual machine (VM) running in a cloudified server array. Additionally, the scheduling node 20 can also refer to other computing devices with corresponding service capabilities, such as terminal devices like computers (running service programs), etc.
[0035] As Figure 1 shown in Step 2 "Test Task Sending" and Figure 3 Step 2 "Storage", the test platform 10 can send the information of the test task to the task allocation node 30. Among them, the task allocation node 30 refers to the node that allocates tasks to the scheduling node, and this scheduling node can be implemented as any computing device, or can also be implemented as Figure 3 the distributed stream processing platform shown. Correspondingly, as Figure 3 shown in Step 2 "Storage", the test platform 10 can write the information of the test task into the message queue provided by the distributed stream processing platform (such as Kafka). Further, as Figure 1 and Figure 3 shown in Step 3 "Test Task Allocation" of
[0036] and
[0037] For a single scheduling node 20, the currently received test task can be 1 or more. More than 1 means 2 or more (including 2). For the currently received test task, the processing logic of the scheduling node 20 for each test task is the same. Here, an example will be given with any currently received test task A for illustrative purposes.
[0038] For any test task A, as Figure 1 shown in Step 4 and Figure 3As shown in step 4, "Test Task Decomposition", the scheduling node 20 can decompose test task A into multiple subtasks. Multiple means two or more (including two). In the embodiments of the present application, the specific implementation manner of decomposing test task A into multiple subtasks is not limited. In Figure 1 and Figure 3 , one test task is decomposed into subtasks 1-3; another test task is decomposed into subtasks 4-5.
[0039] In some embodiments, test task A may include: multiple test units, and different test units perform different test functions. Accordingly, test task A can be decomposed into multiple subtasks according to the functions of the test units of test task A. Specifically, the test units with the same test function can be decomposed into one subtask to obtain multiple subtasks.
[0040] In other embodiments, test task A can be decomposed into multiple subtasks according to the configuration information of test task A. Since the configuration information of test task A contains the parameters and conditions set for the smooth execution of the test task, therefore, performing task splitting based on the configuration information of the test task can ensure that each subtask is self-contained and reduce cross-task dependencies.
[0041] Specifically, the configuration information of the test task may include: test suite information. Among them, the test suite information may include: the identifier of the test suite and / or the configuration information of the test suite. A test task may include one or more test suites. A test suite refers to a set of test instances used to complete a test task. Accordingly, the test suite information can be obtained from the configuration information of test task A; and test task A can be decomposed into multiple subtasks according to the test suite information. Among them, as an independent unit, decomposing tasks according to the test suite information helps to build a clear and modular task structure, making test task management more convenient.
[0042] In some embodiments, the same test suite can be decomposed into one subtask according to the test suite information to obtain multiple subtasks. Since different test suites can usually run in parallel. Therefore, decomposing the same test suite into one subtask provides conditions for subsequent parallel execution of subtasks. In other embodiments, test task A contains multiple test suites. Accordingly, the configuration information of multiple test suites can be obtained from the test suite information; and multiple test suites can be decomposed into multiple subtasks according to the configuration information of multiple test suites. This embodiment can achieve a finer-grained task decomposition of the test task by analyzing the specific configuration of each test suite, which helps to improve the concurrency of subsequent parallel execution of subtasks.
[0043] In some embodiments, a test suite may include a set of test instances. This set of test instances may be one or more. For embodiments where a test suite includes multiple test cases, the configuration information of the test suite may include: the resource allocation policies corresponding to multiple test cases and the resource specification information corresponding to each of the multiple test cases. Accordingly, based on the configuration information of the test suite, the test cases included in each of the multiple test suites can be determined from test task A; for any test suite B among the multiple test suites, according to the resource allocation policy corresponding to test suite B, the resource allocation policy corresponding to the test cases included in test suite B can be determined; the test cases corresponding to the same resource allocation policy under the multiple test suites of test task A can be divided into the same subtask, so as to disassemble test task A into multiple subtasks. In this embodiment, dividing the test cases with the same resource allocation policy into the same subtask can, on the one hand, achieve a finer-grained task disassembly of the test task, which helps to further improve the concurrency of subsequent parallel execution of subtasks; on the other hand, the same subtask has the same resource allocation policy, which is convenient for subsequent resource allocation to the subtasks.
[0044] In some other embodiments, the test cases corresponding to the same resource allocation policy under the same test suite B can be divided into the same subtask. Each test suite can be disassembled into tasks in the same way, so as to disassemble test task A into multiple subtasks. For example, as Figure 4 shown, the test task includes: test suites 1-3. Test suite 1 includes test cases 1-1 to 1-4; test suite 2 includes test cases 2-1 to 2-3; test suite 3 includes test cases 3-1 to 3-3. Among them, the resource allocation policies of test cases 1-1 to 1-4 in test suite 1 are different from each other, so test suite 1-4 can be disassembled into 4 subtasks, namely subtask 1-4. The resource allocation policies of test cases 2-1 and 2-2 in test suite 2 are the same, and the resource allocation policy of test case 2-3 is different from that of test cases 2-1 and 2-2, so test suite 2 can be disassembled into 2 subtasks, that is, test cases 2-1 and 2-2 are divided into the same subtask 5, and test case 2-3 is divided into a subtask 6. The resource allocation policies of test cases 3-2 and 3-3 in test suite 3 are the same, and the resource allocation policy of test case 3-1 is different from that of test cases 3-2 and 3-3, so test suite 3 can be disassembled into 2 subtasks, that is, test case 3-1 is divided into a subtask 7, and test cases 3-2 and 3-3 are divided into the same subtask 5. Therefore, Figure 4 the shown test task is disassembled into 8 subtasks.
[0045] In this embodiment, different test suites for different test tasks belong to different subtasks; different resource allocation strategies for the same test suite belong to different subtasks. In this implementation manner, test cases with the same resource allocation strategy under the same test suite are divided into the same subtask. On the one hand, further splitting the same test suite can achieve a finer-grained task breakdown of the test task, which helps to further improve the concurrency of subsequent subtask parallel execution; on the other hand, the same subtask has the same resource allocation strategy, which facilitates subsequent resource allocation for the subtask. In addition, in this implementation manner, different test suites belong to different subtasks, which can reduce the risk of resource contention between different test suites.
[0046] The breakdown method of the test task shown in the foregoing embodiment is only an exemplary illustration and does not constitute a limitation. In the same way, each test task can be broken down into multiple subtasks. Among them, breaking down a single test task into multiple subtasks can provide conditions for the parallel execution of the test task.
[0047] After breaking down the test task into multiple subtasks, as Figure 1 Step 5 and Figure 3 shown in "Subtask Sending" of Step 5, the scheduling node 20 can send multiple subtasks corresponding to each test task to the task allocation node 30. Further, as Figure 1 Step 6 and Figure 3 shown in "Subtask Allocation" of Step 6, the task allocation node 30 can allocate multiple subtasks to multiple scheduling nodes 20. The task allocation node 30 can allocate multiple subtasks to multiple scheduling nodes 20 according to a preset load balancing strategy. For the description of the load balancing strategy, reference can be made to the relevant content of the foregoing embodiment, which will not be elaborated here. In this way, as Figure 1 Step 7 and Figure 3 shown in "Subtask Resource Scheduling" in Step 7, multiple scheduling nodes 20 can perform resource scheduling on multiple subtasks in parallel, realizing the parallel scheduling of multiple subtasks, which helps to improve the scheduling efficiency of the test task, and thus helps to improve the execution efficiency of the test task.
[0048] Taking any one of the multiple scheduling nodes 20 as an example, an exemplary description will be given of the specific implementation manner of how the scheduling node performs resource scheduling for subtasks. For any one of the multiple scheduling nodes 20, the subtasks obtained by this scheduling node (defined as target subtasks). The target subtasks may be the subtasks obtained by disassembling the test task in the foregoing embodiment; or they may be the subtasks disassembled from other test tasks allocated by the task allocation node, which is not limited. The target subtasks may be one or more. Multiple means two or more (including two). The scheduling node may perform resource scheduling for the target subtasks according to the configuration information of the test task to which the target subtasks belong. For the convenience of description and distinction, the test task to which the target subtasks belong is defined as the target test task. Specifically, the scheduling node 20 may allocate resources for the target subtasks according to the resource configuration information of the target test task. The resources allocated to the subtasks are provided by Figure 1 the computing node 30 shown. Specifically, the scheduling node 20 may allocate resources for the target subtasks according to the resource allocation policy and resource specification information corresponding to the target test task, and may allocate appropriate resources to multiple subtasks of test task A, avoiding the situation of resource waste or shortage.
[0049] The following describes the specific implementation manner of resource allocation for the target subtasks.
[0050] Embodiment 1: The resource allocation policy includes a configuration creation policy. Among them, the configuration creation policy refers to the policy of creating virtual instances in real time according to resource requirements. A virtual instance refers to a virtualized computing resource created in a cloud computing environment. It is a running environment implemented through software simulation and having the functions of a complete hardware system. The virtual instance may be a virtual machine, a container, or a container group (such as a Pod, etc.). Correspondingly, in the case where the resource allocation policy includes a configuration creation policy, the resource specification information of the target test task to which the target subtasks belong can be obtained. The resource specification information corresponding to a test task may be one type of resource specification information, or may include multiple types of resource specification information. Multiple means two or more (including two). For example, the multiple test suites included in the test task have the same or different resource specification information, etc. Correspondingly, at least one virtual instance can be created according to the resource specification information corresponding to each of the multiple test suites. Specifically, if the multiple test suites have the same resource specification information, the scheduling method for this test task is to schedule according to the test task, and then a virtual instance with an adapted resource specification is created according to the same resource specification information corresponding to the multiple test suites; and multiple subtasks of test task A are allocated to this virtual instance.
[0051] If multiple test suites have different resource specification information, for any test suite, a virtual instance adapted to the resource specification information of the test suite can be created according to the resource specification information corresponding to the test suite; further, the subtasks corresponding to the test suite can be assigned to the virtual instance. This scheduling method is scheduling by test suite. Correspondingly, the resource specification information corresponding to the target test suite corresponding to the target subtask can be obtained from the resource specification information corresponding to the target test task to which the target subtask belongs; and a virtual instance can be created according to the resource specification information corresponding to the target test suite corresponding to the target subtask.
[0052] Specifically, it can be determined whether a virtual instance corresponding to the resource specification information has been created for the target test task; if it has been created, the target subtask is assigned to the created virtual instance. If it has not been created, a virtual instance can be created according to the resource specification information of the target test suite; and the target subtask is assigned to the created virtual instance. Among them, by configuring the creation policy, a virtual instance suitable for the operation of its subtasks can be created in real time according to the resource requirements corresponding to the test task, which can ensure the smooth execution of the subtasks.
[0053] Correspondingly, when assigning multiple subtasks of a test task to a virtual instance, for any test suite B, the subtasks corresponding to test suite B can be scheduled to the virtual instance adapted to the resource specification information corresponding to test suite B according to the resource specification information corresponding to test suite B. In this embodiment, since each subtask is assigned to a virtual instance that matches its resource requirements, the task queuing and waiting time caused by resource mismatch are reduced, and the execution efficiency is improved. On the other hand, for the embodiment in which different test suites under the same test task specify different resource specifications, the subtasks corresponding to different test suites can be assigned to different virtual instances by reasonably allocating resources, increasing the concurrent processing ability and helping to improve the test efficiency.
[0054] Embodiment 2: The resource allocation strategy includes an inherent virtual instance allocation strategy. The inherent virtual instance allocation strategy refers to the strategy of allocating corresponding virtual instances for test tasks from the inherent virtual instances. In some embodiments, the inherent virtual instance allocation strategy may include: the identifiers of the virtual instances specified by each of the multiple test suites under test task A. The specified virtual instances may be dedicated (Special, SPEC) virtual instances, snapshot (SNAP) virtual instances, or tag (TAG) virtual instances, etc. A tag virtual instance refers to a method in a cloud computing environment of allocating specific tags (Tags) to virtual instances to facilitate the management and identification of these resources. Tags are user-defined metadata, usually attached to virtual instances in the form of key-value pairs, enabling users to classify, search, filter, and automate the management of resources based on these tags. Correspondingly, in the case where the resource allocation strategy corresponding to the test task is the inherent virtual instance allocation strategy, the target subtask can be allocated to the inherent virtual instance corresponding to the identifier of the virtual instance specified by the target test suite corresponding to the target subtask. In this embodiment, by specifying specific virtual instances for each test suite, it can be ensured that each execution is carried out in the same environment, which helps to ensure the reliability and repeatability of the test results. On the other hand, each test suite has its own virtual instance, which can effectively avoid the situation where multiple test suites compete for the same resources, reducing resource contention and potential performance bottlenecks.
[0055] In other embodiments, the inherent virtual instance allocation strategy may include: the resource specification information corresponding to the target test suite corresponding to the target subtask. Correspondingly, in the case where the resource allocation strategy corresponding to the test task is the inherent virtual instance allocation strategy, the target subtask can be allocated to the inherent virtual instance adapted to the resource specification information corresponding to the target test suite. Specifically, an inherent virtual instance adapted to the resource specification information corresponding to the target test suite can be randomly selected from the inherent virtual instances, and the target subtask can be allocated to this inherent virtual instance. This embodiment can improve the execution efficiency and performance of the subtask by ensuring that each test suite runs on a virtual instance that meets its specific resource requirements, and helps to avoid resource waste caused by over-provisioning or performance bottlenecks caused by insufficient configuration.
[0056] In some embodiments, the configuration information of the test task may further include: the task priority of the test task. The task priority refers to the priority of executing the test task. Correspondingly, the scheduling node 20 can allocate resources to the target subtasks corresponding to multiple test tasks in sequence according to the task priorities of the multiple test tasks. For test tasks with the same task priority, resources can be allocated to the target subtasks corresponding to each of the test tasks with the same task priority according to the creation time of the test tasks. The specific resource allocation method can refer to the relevant content of the foregoing embodiments and will not be elaborated here.
[0057] After the scheduling node 20 allocates resources for each target subtask, the resource allocation information for each target subtask can be obtained. The resource allocation information may include: the identifier of the virtual instance allocated to the target subtask, etc. Further, the scheduling node 20 can schedule at least one target subtask to the resources allocated to each of the at least one target subtasks according to the resource allocation information of the at least one target subtask received and the task priorities of the target test tasks to which the at least one target subtasks belong. In this way, the resources allocated to each target subtask can execute the test case corresponding to the target subtask, thereby completing the test task and obtaining the test result. In this embodiment, by scheduling the target subtasks according to the resource allocation information and task priorities of the subtasks, high-priority test tasks can be preferentially executed. When the high-priority tasks complete and release resources, the low-priority tasks can immediately use these resources, improving the overall resource utilization rate. On the other hand, multiple scheduling nodes concurrently execute the test task scheduling method provided in the foregoing embodiment, which helps to improve the execution efficiency of concurrent test tasks.
[0058] In the embodiment of the present application, for the embodiment where the number of target subtasks received by a scheduling node is 1, the scheduling node can directly schedule the target subtask to the resources allocated to the target subtask according to the resource allocation information of the target subtask. Hereinafter, taking the case where the number of target subtasks received by the scheduling node is multiple as an example, the specific implementation manner of scheduling at least one target subtask to the resources allocated to each of the at least one target subtasks according to the resource allocation information of the at least one target subtask received and the task priorities of the target test tasks to which the at least one target subtasks belong will be described. In some embodiments, multiple target subtasks can be sequentially scheduled to the virtual instances allocated to the multi-target subtasks according to the task priorities of the target test tasks to which the multiple target subtasks belong. For example, for the first test task and the second test task with adjacent task priorities among multiple test tasks, the target subtasks of the first test task can be first scheduled to the virtual instances allocated to the target subtasks of the first test task; then, the target subtasks of the second test task can be respectively scheduled to the virtual instances allocated to the target subtasks of the second test task. This implementation manner can make high-priority test tasks be preferentially executed. When the high-priority tasks complete and release resources, the low-priority tasks can immediately use these resources, improving the overall resource utilization rate.
[0059] In some other embodiments, the target subtasks assigned to the same virtual instance can be determined according to the identifiers of the virtual instances assigned to multiple target subtasks; thereafter, the target subtasks assigned to the same virtual instance can be scheduled onto the virtual instance (defined as the target virtual instance) in sequence according to the task priorities of the target test tasks to which the target subtasks assigned to the same virtual instance belong. The target virtual instance refers to the virtual instance to which the target subtasks assigned to the same virtual instance are assigned. This embodiment can sort and schedule the subtasks on the same virtual instance based on the priorities of their respective test tasks. This means that even the subtasks of different test tasks assigned to the same virtual instance can be given an appropriate processing order according to their task priorities, providing finer-grained control. On the other hand, by managing the task priorities at the single virtual instance level, tasks with lower priorities will not be executed until tasks with higher priorities are completed, which can more effectively reduce resource contention and contribute to improving resource utilization efficiency.
[0060] In some embodiments, the execution order of the target subtasks assigned to the same virtual instance can be determined according to the task priorities of the test tasks to which the target subtasks assigned to the same virtual instance belong; thereafter, the target subtasks assigned to the same virtual instance can be scheduled onto the target virtual instance in sequence according to the execution order of the target subtasks assigned to the same virtual instance.
[0061] In some other embodiments, a linked list of the target subtasks assigned to the target virtual instance can be established according to the execution order of the target subtasks assigned to the same virtual instance. A linked list is a basic data structure used to store and organize data. Different from an array, the elements in a linked list are not stored in consecutive memory locations but are connected to each other through pointers (references). Each element (usually called a node) contains two parts: a data field and a pointer field pointing to the next node. Accordingly, according to the execution order of the subtasks assigned to the same virtual instance, the subtasks assigned to the target virtual instance and the pointers pointing to the next subtask of the subtask can be stored in the linked list, thereby obtaining the linked list of the subtasks assigned to the target virtual instance. For example, as Figure 5 shown, subtask 1, subtask 4, and subtask 10 in linked list 1 are assigned to the same virtual instance 1. In linked list 1, subtask 1 points to subtask 4, and subtask 4 points to subtask 10. Subtask 2 and subtask 5 in linked list 2 are assigned to the same virtual instance 2. In linked list 2, subtask 2 points to subtask 5. Subtask 3 and subtask 8 in linked list 3 are assigned to the same virtual instance 3. In linked list 3, subtask 3 points to subtask 8.
[0062] Among them, the name of the linked list can be the identifier of the corresponding virtual instance. Figure 5Taking the name of the linked list as the identifier of the virtual instance under the Workspace as an example for illustration. In this embodiment, the Workspace is divided according to the computing nodes where the virtual instances are located by the user. The user can only use the computing nodes under the Workspace to which they belong to execute test tasks, that is, the virtual instances allocated for the test tasks provided for the user are the virtual instances deployed on the computing nodes under the Workspace to which the user belongs.
[0063] Further, according to the linked list, the target subtasks allocated to the same virtual instance can be scheduled to the target virtual instance in sequence. Among them, organizing and managing the subtasks of the same virtual instance through the linked list makes the subtasks and their execution order clear at a glance, facilitating the tracking and management of the task status on each virtual instance.
[0064] In some embodiments, the linked list can be stored in a memory-based data structure storage system (such as the Redis system); further, when the corresponding virtual instance is idle, the linked list can be read from the memory-based data structure storage system, and according to the order of the target subtasks allocated to the same virtual instance in the linked list, the target subtasks allocated to the same virtual instance can be scheduled to the target virtual instance in sequence. Since the linked list is stored in a memory-based data structure storage system, reading the linked list from the memory can improve the reading efficiency of the linked list, and thus help improve the subsequent task scheduling efficiency.
[0065] In some embodiments, such as Figure 3 shown in "subtask data caching" in step 7, the subtask data can also be stored in the memory-based data structure storage system 50. Among them, as Figure 6 shown, the subtask data may include: the identifier of the subtask, the creation time, the latest modification time, whether it is deleted, the identifier of the test task to which the subtask belongs, the resource specification information and resource allocation policy corresponding to the subtask, the completion status of the subtask, the mode and type of the virtual instance to which the subtask is allocated, the environment configuration information of the subtask, and the completion time of the subtask, etc. Among them, the mode of the virtual instance to which the subtask is allocated can be the single-machine mode or the cluster mode. The type of the virtual instance can be the internal network machine type or the elastic machine type. The internal network machine type refers to the computing nodes deployed in the user's internal network. The elastic machine type refers to the computing nodes deployed in the public cloud.
[0066] In some embodiments of the present application, when scheduling the subtasks allocated to the same virtual instance according to the task priorities of the test tasks to which the target subtasks allocated to the same virtual instance belong, for any target subtask D scheduled currently, such as Figure 3As shown in step 6 "Sub - task splitting", the target sub - task D can be split into multiple steps (Steps) according to the resource allocation strategy corresponding to the target sub - task D and the environment configuration information of the test task to which the target sub - task D belongs. Each step can be encapsulated as an independently executable script.
[0067] Specifically, if the resource allocation strategy corresponding to the target sub - task D is the configuration creation strategy, then it is determined that the first step of the target sub - task D is to create a virtual instance. After that, according to the environment configuration information of the test task to which the target sub - task D belongs, other steps of the target sub - task D can be determined. Optionally, according to the environment configuration information of the test task to which the target sub - task D belongs, the environment configuration items of the test task to which the target sub - task D belongs can be determined; after that, according to the logical order between the environment configuration items, other steps of the target sub - task D can be determined. The environment configuration items can include one or more of: reinstall machine configuration item, reinstall kernel configuration item, restart machine configuration item, global variable configuration item, install PM configuration item, execute script configuration item, console configuration item, and monitoring configuration item, etc.
[0068] For example, assume that the environment configuration items of the test task to which the target sub - task D belongs include: reinstall machine configuration item, reinstall kernel configuration item, restart machine configuration item, global variable configuration item, install PM configuration item, execute script configuration item, console configuration item, and monitoring configuration item. Then other steps of the target sub - task D include: (1) Reinstall machine configuration item: reinstall the operating system; (2) Reinstall kernel configuration item: install the released kernel; (3) Restart machine configuration item: whether to turn on the restart machine switch; (4) Global variable configuration item: configure the global variables of the test task; (5) Install PM and select the installation time; (6) Execute script configuration item: turn on the script function; (7) Console configuration item: turn on the console function at the test case level; (8) Monitoring configuration item: turn on the monitoring function at the test case level; (9) Execute the test case of sub - task D. Among them, other steps included in sub - task D can be flexibly selected according to whether the corresponding configuration items are set.
[0069] If the resource allocation strategy corresponding to the target sub - task D is the inherent virtual instance allocation strategy, then according to the environment configuration information of the test task to which the target sub - task D belongs, the target sub - task D is split into multiple steps. Regarding the specific implementation of splitting the target sub - task D into multiple steps according to the environment configuration information of the test task to which the target sub - task D belongs, the specific content of determining the environment configuration items of the test task to which the target sub - task D belongs as described above can be referred to.
[0070] In some embodiments, the information of multiple steps included in the sub - task can also be written into the sub - task data structure. Such as Figure 6As shown, the subtask data may also include: the number of steps included in the subtask and the specific steps.
[0071] Furthermore, according to the sequence of multiple steps, the multiple steps can be scheduled to the same virtual instance in sequence, so as to schedule the target subtask D to this target virtual instance. Splitting the subtask into multiple steps makes the entire execution process more transparent, facilitating the tracking and management of the status and progress of each step. If a specific step fails, it is easier to locate the problem and take targeted measures to solve the problem without affecting the normal execution of other steps.
[0072] Specifically, the multiple steps can be sent to the task assignment node. For example, the multiple steps can be sent to the task assignment node 30, such as a distributed stream processing platform (such as Kafka, etc.). The task assignment node (such as a distributed stream processing platform) can write the multiple steps into the message queue. The task assignment node (such as a distributed stream processing platform) can, according to the preset load balancing strategy, distribute the multiple steps to multiple scheduling nodes to achieve the load balancing of the scheduling nodes. The task assignment node (such as a distributed stream processing platform) can, according to the sequence of multiple steps of the target subtask D, trigger multiple scheduling nodes to schedule the assigned steps in sequence, so that the multiple scheduling nodes schedule the multiple steps to the virtual instance assigned to the target subtask D in sequence according to the sequence of multiple steps.
[0073] Specifically, when any one of the multiple scheduling nodes schedules the multiple steps to the target virtual instance in sequence according to the sequence of multiple steps of the target subtask D, it can, in response to the trigger operation of the distributed stream processing platform, schedule the step X assigned to this scheduling node to the virtual instance assigned to the target subtask D. After the scheduling node schedules the assigned step X to the virtual instance assigned to the target subtask D, it can send a completion message to the distributed stream processing platform. The task assignment node (such as a distributed stream processing platform) can, in response to the completion message, trigger the scheduling node of the next step assigned to step X. The scheduling node of the next step assigned to step X can, in response to the trigger operation of the task assignment node (such as a distributed stream processing platform), schedule the next step of step X assigned to this scheduling node to the virtual instance assigned to the target subtask D, and loop in sequence until the multiple steps of the target subtask D are scheduled completely. In this embodiment, the distributed stream processing platform distributes the multiple steps of the same target subtask to multiple scheduling nodes to achieve the load balancing of the scheduling nodes.
[0074] The scheduling node 20 schedules each sub-task to the resource assigned to the sub-task. The resources assigned to each sub-task (such as virtual instances like virtual machines) can execute the test cases corresponding to the sub-tasks, thereby realizing the testing of the test object corresponding to the test task. During the execution of the test task, the user and the scheduling node can perceive the execution status of the test task from different perspectives. For example, Figure 7 As shown, from the user's perspective, what the user can perceive is the execution status of each test suite under the test task and the execution status of each test case under the test suite. Among them, the execution status of the test suite and the execution status of the test case can include: execution success, failure, running, paused, skipped, etc.
[0075] For example, Figure 8 As shown, from the perspective of the scheduling node, the test task is disassembled into multiple sub-tasks, and the test cases corresponding to the multiple sub-tasks are executed to execute the sub-tasks. The scheduling node can perceive the execution status of the multiple sub-tasks. During the process of the virtual instance executing the test case corresponding to the target sub-task, the execution status of the target sub-task can be monitored. Specifically, the execution status of multiple steps included in the target sub-task can be monitored, and the execution status of the target sub-task can be recorded, such as the execution status of each step of the target sub-task. The scheduling node 20 can obtain the execution status of the target sub-task. If the execution status of the target sub-task is abnormal, other test cases (defined as target test cases) on which the test case corresponding to the target sub-task depends are determined. Further, the scheduling node 20 can re-allocate resources to the target sub-task with an exception and the sub-task corresponding to the target test case, and schedule the sub-task corresponding to the target test case and the target sub-task with an exception to their respective re-allocated resources in sequence. The re-allocated resources corresponding to the abnormal target sub-task and the sub-task corresponding to the target test case can execute the target test case and the test case corresponding to the target sub-task with an exception, thereby realizing the recovery of the failed test case. Specifically, the target test case is executed first, and then the test case corresponding to the target sub-task with an exception is executed. Since the test case corresponding to the sub-task with an exception depends on the target test case, therefore, executing the target test case first and then the test case corresponding to the sub-task with an exception can ensure that the test case corresponding to the sub-task with an exception can be executed smoothly. This embodiment can capture the sub-task with an execution exception and recover the sub-task with an execution exception by means of the real-time monitoring mechanism of the monitoring tool, which can ensure the test availability and reliability.
[0076] For example, as Figure 9 shown, the test task is disassembled into sub-tasks 1-3. Among them, sub-task 1 and sub-task 3 use the same virtual instance 1; sub-task 2 uses another virtual instance 2. The monitoring tool can monitor the execution status of the sub-tasks in real time. Among them, the monitoring tool can be deployed on the virtual instance. If the execution status of sub-task 2 is monitored to be abnormal,Figure 9 Taking the exception of subtask 2 caused by timeout in pulling test case code as an example for illustration, the scheduling node can be notified to save the current state of subtask 2. The scheduling node can re - schedule resources for subtask 2 in case of an exception in subtask 2. Specifically, the target test case on which the test case corresponding to subtask 2 depends can be determined, and resources can be re - scheduled for the subtask corresponding to the target test case and subtask 2. After that, the subtask corresponding to the target test case can be first sent to the allocated resources to execute the target test case; then, subtask 2 can be sent to the resources allocated to subtask 2 to execute subtask 2, thus realizing the automatic recovery of subtask 2. In the embodiments of the present application, in order to prevent subtasks from "starving" due to long - term waiting for scheduling, a starvation prevention mechanism is proposed. Among them, a subtask "starving" means that some subtasks, due to resource competition or other scheduling strategies, cannot obtain the necessary resources for a long time, resulting in these subtasks being in a waiting state for a long time without being executed. Specifically, as Figure 10 shown in "Timing", for any of the foregoing target subtasks D, the waiting time of the target subtask D can be timed. Specifically, after the test task is split into multiple subtasks, the waiting times of the multiple subtasks can be timed respectively. Further, as Figure 10 shown, if the target subtask D has not been scheduled after exceeding the set waiting duration, it is queried whether the resources allocated to the target subtask D are in an idle state. If the resources allocated to the target subtask D are in an idle state, the target subtask D is scheduled to the resources allocated to the target subtask D to execute the test case corresponding to the target subtask D by using the resources allocated to the target subtask D. If the resources allocated to the target subtask D are in an occupied state, the target subtask D is written into the set message queue and waits for scheduling. In order to distinguish from the message queue provided by the foregoing distributed stream processing platform, in the following embodiments of the present application, the message queue provided by the distributed stream processing platform is defined as the first message queue; and the queue used to store "starving" subtasks is defined as the second message queue.
[0077] To prevent the subtasks in the second message queue from starving, it is also possible to monitor the usage status of the resources allocated to each subtask of the aforementioned multiple test tasks, and when it is detected that there are idle resources among the resources allocated to each subtask of the multiple test tasks, search in the second message queue for the subtasks whose allocated resources match the idle resources. The allocated resources matching the idle resources specifically means that the resource specifications of the idle resources are the same as the resource specifications of the resources allocated to the subtasks. Further, the target subtasks matching the idle resources can be scheduled to the idle resources. The idle resources can execute the test cases corresponding to the desired subtasks. This embodiment can effectively prevent the situation where some subtasks "starve" due to not being scheduled for a long time. On the other hand, by dynamically monitoring the usage status of resources and promptly scheduling the waiting subtasks when idle resources are found, the overall utilization rate of resources is improved and resource waste is reduced.
[0078] In addition to the above scheduling system, the embodiments of the present application also provide a test task scheduling method. The following will describe the test task scheduling method provided by the embodiments of the present application from the perspective of the scheduling node.
[0079] Figure 11 It is a schematic flowchart of the test task scheduling method provided by the embodiments of the present application. This method is mainly applicable to any scheduling node in a distributed scheduling system. As Figure 11 shown, the test task scheduling method mainly includes the following steps: 1101. Obtain a test task.
[0080] 1102. According to the configuration information of the test task, disassemble the test task into multiple subtasks.
[0081] 1103. Send the multiple subtasks to the task allocation node for the task allocation node to allocate the multiple subtasks to multiple scheduling nodes for parallel resource scheduling.
[0082] In some embodiments of the present application, the test task can be created by the user through the test platform. For the specific implementation of creating a test task through the test platform, reference can be made to the relevant content of the aforementioned system embodiments, which will not be elaborated here. The test task obtained by the scheduling node can be allocated by the task allocation node. For the specific implementation of the task allocation node allocating the test task to the scheduling node, reference can be made to the relevant content of the aforementioned system embodiments, which will not be elaborated here.
[0083] The test task obtained in step 1101 can be one or more. Multiple means two or more (including two). For the currently received test task, the processing logic of each test task by the scheduling node is the same. The following will take any currently received test task as an example for exemplary illustration.
[0084] For any test task, the test task can be decomposed into multiple subtasks. Multiple means two or more (including two). In the embodiments of the present application, the specific implementation manner of decomposing the test task into multiple subtasks is not limited.
[0085] In some embodiments, the test task may include: multiple test units, and different test units perform different test functions. Accordingly, the test task can be decomposed into multiple subtasks according to the functions of the test units of the test task. Specifically, the test units with the same test function can be decomposed into one subtask to obtain multiple subtasks.
[0086] In other embodiments, in step 1102, the test task can be decomposed into multiple subtasks according to the configuration information of the test task. Since the configuration information of the test task includes the parameters and conditions set for the test task to be successfully executed, therefore, based on the configuration information of the test task for task splitting, it can ensure that each subtask is self - contained and reduce cross - task dependencies.
[0087] Specifically, the configuration information of the test task may include: test suite information. Among them, the test suite information may include: the identifier of the test suite and / or the configuration information of the test suite. A test task may include one or more test suites. A test suite refers to a set of test instances used to complete a test task. Accordingly, the test suite information can be obtained from the configuration information of the test task; and the test task can be decomposed into multiple subtasks according to the test suite information. Among them, the test suite, as an independent unit, decomposing the task according to the test suite information helps to construct a clear and modular task structure, making the management of the test task more convenient.
[0088] In some embodiments, the same test suite can be decomposed into one subtask according to the test suite information to obtain multiple subtasks. Since different test suites can usually run in parallel. Therefore, decomposing the same test suite into one subtask provides conditions for subsequent parallel execution of subtasks. In other embodiments, the test task contains multiple test suites. Accordingly, the configuration information of multiple test suites can be obtained from the test suite information; and multiple test suites can be decomposed into multiple subtasks according to the configuration information of multiple test suites. This embodiment can achieve a finer - grained task decomposition of the test task by analyzing the specific configuration of each test suite, which helps to improve the concurrency of subsequent parallel execution of subtasks.
[0089] In some embodiments, a test suite may include a set of test instances. This set of test instances may be one or more. For embodiments where a test suite includes multiple test cases, the configuration information of the test suite may include: the resource allocation policies corresponding to the multiple test cases and the resource specification information corresponding to each of the multiple test cases. Accordingly, based on the configuration information of the test suite, the test cases included in each of the multiple test suites can be determined from the test task; for any test suite B among the multiple test suites, based on the resource allocation policy corresponding to test suite B, the resource allocation policy corresponding to the test cases included in test suite B can be determined; the test cases corresponding to the same resource allocation policy under the multiple test suites of test task A can be divided into the same subtask, so as to disassemble test task A into multiple subtasks. In this embodiment, dividing the test cases with the same resource allocation policy into the same subtask can, on the one hand, achieve a finer-grained task disassembly of the test task, which helps to further improve the concurrency of subsequent parallel execution of subtasks; on the other hand, the same subtask has the same resource allocation policy, which is convenient for subsequent resource allocation to the subtasks.
[0090] In some other embodiments, the test cases corresponding to the same resource allocation policy under the same test suite B can be divided into the same subtask. Each test suite can be disassembled into subtasks in the same way, so as to disassemble test task A into multiple subtasks.
[0091] In this embodiment, different test suites of different test tasks belong to different subtasks; different resource allocation policies of the same test suite belong to different subtasks. In this implementation, dividing the test cases with the same resource allocation policy under the same test suite into the same subtask can, on the one hand, further disassemble the same test suite, achieve a finer-grained task disassembly of the test task, and help to further improve the concurrency of subsequent parallel execution of subtasks; on the other hand, the same subtask has the same resource allocation policy, which is convenient for subsequent resource allocation to the subtasks. In addition, in this implementation, different test suites belong to different subtasks, which can reduce the risk of resource contention between different test suites.
[0092] The disassembly methods of the test tasks shown in the foregoing embodiments are only illustrative and do not constitute a limitation. Each test task can be disassembled into multiple subtasks in the same way. Among them, disassembling a single test task into multiple subtasks can provide conditions for the parallel execution of the test task.
[0093] After disassembling the test task into multiple subtasks, in step 1103, each test task corresponding to multiple subtasks can be sent to the task allocation node. Further, the task allocation node can allocate multiple subtasks to multiple scheduling nodes. The task allocation node can allocate multiple subtasks to multiple scheduling nodes according to a preset load balancing strategy. For the description of the load balancing strategy, reference can be made to the relevant content of the foregoing embodiments, which will not be elaborated here. In this way, multiple scheduling nodes can perform resource scheduling on multiple subtasks in parallel, realizing parallel scheduling of multiple subtasks, which helps to improve the scheduling efficiency of the test task and thus helps to improve the execution efficiency of the test task.
[0094] Taking any one of the multiple scheduling nodes as an example below, an exemplary description will be given of the specific implementation manner of how the scheduling node performs resource scheduling on the subtasks. For any one of the multiple scheduling nodes, for the subtasks obtained by this scheduling node (defined as target subtasks). The target subtasks can be one or more. Multiple means two or more (including two). The scheduling node can perform resource scheduling on the target subtasks according to the configuration information of the test task to which the target subtasks belong. For the convenience of description and distinction, the test task to which the target subtasks belong is defined as the target test task. Specifically, resources can be allocated to the target subtasks according to the resource configuration information of the target test task. Specifically, resources can be allocated to the target subtasks according to the resource allocation strategy and resource specification information corresponding to the target test task, and appropriate resources can be allocated to multiple subtasks of test task A, avoiding the situation of resource waste or shortage.
[0095] The following describes the specific implementation manner of resource allocation for the target subtasks.
[0096] Embodiment 1: The resource allocation strategy includes a configuration creation strategy. Among them, the configuration creation strategy refers to the strategy of creating virtual instances in real time according to resource requirements. Correspondingly, in the case where the resource allocation strategy includes the configuration creation strategy, the resource specification information of the target test task to which the target subtasks belong can be obtained. The resource specification information corresponding to one test task can be one type of resource specification information, or can include multiple types of resource specification information. Multiple means two or more (including two). For example, multiple test suites included in the test task have the same or different resource specification information, etc. Correspondingly, at least one virtual instance can be created according to the resource specification information corresponding to each of the multiple test suites. Specifically, if the multiple test suites have the same resource specification information, the scheduling method of this test task is to schedule according to the test task, then according to the same resource specification information corresponding to the multiple test suites, a virtual instance with an adapted resource specification is created; and multiple subtasks of test task A are allocated to this virtual instance.
[0097] If multiple test suites have different resource specification information, for any test suite, a virtual instance adapted to the resource specification information of the test suite can be created according to the resource specification information corresponding to the test suite; further, the subtasks corresponding to the test suite can be assigned to the virtual instance. This scheduling method is scheduling by test suite. Accordingly, the resource specification information corresponding to the target test suite corresponding to the target subtask can be obtained from the resource specification information corresponding to the target test task to which the target subtask belongs; and a virtual instance can be created according to the resource specification information corresponding to the target test suite corresponding to the target subtask.
[0098] Specifically, it can be determined whether a virtual instance corresponding to the resource specification information has been created for the target test task; if it has been created, the target subtask is assigned to the created virtual instance. If it has not been created, a virtual instance can be created according to the resource specification information of the target test suite; and the target subtask is assigned to the created virtual instance. Among them, by configuring the creation policy, a virtual instance suitable for the operation of its subtasks can be created in real time according to the resource requirements corresponding to the test task, which can ensure the smooth execution of the subtasks.
[0099] Accordingly, when assigning multiple subtasks of a test task to a virtual instance, for any test suite B, the subtasks corresponding to the test suite B can be scheduled to the virtual instance adapted to the resource specification information corresponding to the test suite B according to the resource specification information corresponding to the test suite B. In this embodiment, since each subtask is assigned to a virtual instance that matches its resource requirements, the task queuing and waiting time caused by resource mismatch are reduced, and the execution efficiency is improved. On the other hand, for the embodiment in which different test suites under the same test task specify different resource specifications, the subtasks corresponding to different test suites can be assigned to different virtual instances by reasonably allocating resources, increasing the concurrent processing ability and helping to improve the test efficiency.
[0100] Embodiment 2: The resource allocation strategy includes an inherent virtual instance allocation strategy. The inherent virtual instance allocation strategy refers to the strategy of allocating corresponding virtual instances for test tasks from the inherent virtual instances. In some embodiments, the inherent virtual instance allocation strategy may include: the identifiers of the virtual instances specified by each of the multiple test suites under the test task. Correspondingly, when the resource allocation strategy corresponding to the test task is the inherent virtual instance allocation strategy, the target subtask can be allocated to the inherent virtual instance corresponding to the identifier of the virtual instance specified by the target test suite corresponding to the target subtask. In this embodiment, by specifying a specific virtual instance for each test suite, it can be ensured that the execution is carried out in the same environment each time, which helps to ensure the reliability and repeatability of the test results. On the other hand, each test suite has its own virtual instance, which can effectively avoid the situation where multiple test suites compete for the same resource, reducing resource contention and potential performance bottlenecks.
[0101] In other embodiments, the inherent virtual instance allocation strategy may include: the resource specification information corresponding to the target test suite corresponding to the target subtask. Correspondingly, when the resource allocation strategy corresponding to the test task is the inherent virtual instance allocation strategy, the target subtask can be allocated to the inherent virtual instance adapted to the resource specification information corresponding to the target test suite. Specifically, an inherent virtual instance adapted to the resource specification information corresponding to the target test suite can be randomly selected from the inherent virtual instances, and the target subtask can be allocated to this inherent virtual instance. This embodiment can improve the execution efficiency and performance of the subtask by ensuring that each test suite runs on a virtual instance that meets its specific resource requirements, which helps to avoid resource waste caused by over-configuration or performance bottlenecks caused by insufficient configuration.
[0102] In some embodiments, the configuration information of the test task may further include: the task priority of the test task. The task priority refers to the priority of executing this test task. Correspondingly, resources can be allocated to the target subtasks corresponding to multiple test tasks in sequence according to the task priorities of the multiple test tasks. For test tasks with the same task priority, resources can be allocated to the target subtasks corresponding to the test tasks with the same task priority according to the creation time of the test tasks. The specific resource allocation method can refer to the relevant content of the foregoing embodiments and will not be elaborated here.
[0103] After resources are allocated to each target subtask, the resource allocation information for each target subtask can be obtained. The resource allocation information may include, for example, the identifier of the virtual instance allocated to the target subtask. Further, at least one target subtask can be scheduled to the resources allocated to each of the at least one target subtasks according to the resource allocation information of the at least one target subtask received and the task priorities of the target test tasks to which the at least one target subtasks belong. In this way, the resources allocated to each target subtask can execute the test case corresponding to the target subtask, thereby completing the test task and obtaining the test result. In this embodiment, scheduling the target subtasks according to the resource allocation information and task priorities of the subtasks can enable high-priority test tasks to be executed first. After the high-priority tasks are completed and resources are released, low-priority tasks can immediately use these resources, improving the overall resource utilization rate. On the other hand, multiple scheduling nodes concurrently execute the test task scheduling method provided in the foregoing embodiment, which helps to improve the execution efficiency of concurrent test tasks.
[0104] In the embodiment of the present application, for an embodiment where the number of target subtasks received by a scheduling node is 1, the scheduling node can directly schedule the target subtask to the resources allocated to the target subtask according to the resource allocation information of the target subtask. Below, taking the case where the number of target subtasks received by the scheduling node is multiple as an example, the specific implementation manner of scheduling at least one target subtask to the resources allocated to each of the at least one target subtasks according to the resource allocation information of the at least one target subtask received and the task priorities of the target test tasks to which the at least one target subtasks belong will be described. In some embodiments, multiple target subtasks can be sequentially scheduled to the virtual instances allocated to the multi-target subtasks according to the task priorities of the target test tasks to which the multiple target subtasks belong. This implementation can enable high-priority test tasks to be executed first. After the high-priority tasks are completed and resources are released, low-priority tasks can immediately use these resources, improving the overall resource utilization rate.
[0105] In some other embodiments, the target subtasks assigned to the same virtual instance can be determined according to the identifiers of the virtual instances assigned to multiple target subtasks; then, the target subtasks assigned to the same virtual instance can be scheduled to the target virtual instance in sequence according to the task priorities of the target test tasks to which the target subtasks assigned to the same virtual instance belong. The target virtual instance refers to the virtual instance to which the target subtasks assigned to the same virtual instance are assigned. This implementation can sort and schedule subtasks on the same virtual instance based on the priorities of their respective test tasks. This means that even the subtasks of different test tasks assigned to the same virtual instance can be given an appropriate processing order according to their task priorities, providing finer-grained control. On the other hand, by managing task priorities at the single virtual instance level, lower-priority tasks will not be executed until higher-priority tasks are completed, which can more effectively reduce resource contention and contribute to improving resource utilization efficiency.
[0106] In some embodiments, the execution order of the target subtasks assigned to the same virtual instance can be determined according to the task priorities of the test tasks to which the target subtasks assigned to the same virtual instance belong; then, the target subtasks assigned to the same virtual instance can be scheduled to the target virtual instance in sequence according to the execution order of the target subtasks assigned to the same virtual instance.
[0107] In some other embodiments, a linked list of the target subtasks assigned to the target virtual instance can be established according to the execution order of the target subtasks assigned to the same virtual instance. The name of the linked list can be the identifier of the corresponding virtual instance. Further, according to this linked list, the target subtasks assigned to the same virtual instance can be scheduled to the target virtual instance in sequence. By organizing and managing the subtasks of the same virtual instance through a linked list, the status of each subtask and its execution order are clear at a glance, facilitating the tracking and management of the task status on each virtual instance.
[0108] In some embodiments, the linked list can be stored in a memory-based data structure storage system (such as the Redis system); further, when the corresponding virtual instance is idle, the linked list can be read from the memory-based data structure storage system, and according to the sequence of the target subtasks assigned to the same virtual instance in the linked list, the target subtasks assigned to the same virtual instance can be scheduled to the target virtual instance in sequence. Since the linked list is stored in a memory-based data structure storage system, reading the linked list from memory can improve the linked list reading efficiency, which in turn helps to improve the subsequent task scheduling efficiency.
[0109] In some embodiments, the subtask data can also be stored in a memory-based data structure storage system. For the specific content of the subtask data, reference can be made to the description of the foregoing system embodiments.
[0110] In some embodiments of the present application, when scheduling subtasks assigned to the same virtual instance according to the task priorities of the test tasks to which the target subtasks belonging to the same virtual instance belong, for any target subtask D currently scheduled, the target subtask D can be split into multiple steps (Steps) according to the resource allocation policy corresponding to the target subtask D and the environment configuration information of the test task to which the target subtask D belongs. Each step can be encapsulated as an independently executable script.
[0111] In some embodiments, the information of multiple steps included in the subtask can also be written into the subtask data structure. The subtask data can also include: the number of steps included in the subtask and the specific steps.
[0112] Furthermore, according to the sequence of the multiple steps, the multiple steps can be sequentially scheduled to the same virtual instance, so as to schedule the target subtask D to the target virtual instance. Splitting the subtask into multiple steps makes the entire execution process more transparent, facilitating the tracking and management of the status and progress of each step. If a specific step fails, it is easier to locate the problem and take targeted measures to solve the problem without affecting the normal execution of other steps.
[0113] Specifically, the multiple steps can be sent to the task allocation node. For example, the multiple steps can be sent to the task allocation node, such as a distributed stream processing platform (such as Kafka, etc.). The task allocation node (such as a distributed stream processing platform) can write the multiple steps into the message queue. The task allocation node (such as a distributed stream processing platform) can, according to the preset load balancing policy, allocate the multiple steps to multiple scheduling nodes to achieve load balancing of the scheduling nodes. The task allocation node (such as a distributed stream processing platform) can, according to the sequence of the multiple steps of the target subtask D, sequentially trigger the multiple scheduling nodes to schedule the allocated steps, so that the multiple scheduling nodes, according to the sequence of the multiple steps, sequentially schedule the multiple steps to the virtual instance assigned to the target subtask D.
[0114] Specifically, when any one of multiple scheduling nodes schedules multiple steps of a target subtask D in sequence to the same virtual instance according to the sequence of the multiple steps, in response to a trigger operation of the distributed stream processing platform, the step X assigned to this scheduling node can be scheduled to the virtual instance assigned to the target subtask D. After the scheduling node schedules the assigned step X to the virtual instance assigned to the target subtask D, a completion message can be sent to the distributed stream processing platform. The task assignment node (such as the distributed stream processing platform) can, in response to the completion message, trigger the scheduling node for the next step assigned to step X. The scheduling node for the next step assigned to step X can, in response to the trigger operation of the task assignment node (such as the distributed stream processing platform), schedule the next step of step X assigned to this scheduling node to the virtual instance assigned to the target subtask D, and loop in sequence until multiple steps of the target subtask D are scheduled. In this embodiment, by the distributed stream processing platform, multiple steps of the same target subtask are assigned to multiple scheduling nodes, achieving load balancing of the scheduling nodes.
[0115] Furthermore, each subtask can be scheduled to the resource assigned to this subtask, and the resources assigned to each subtask (such as virtual instances like virtual machines) can execute the test cases corresponding to the subtask, thereby implementing testing of the test object corresponding to the test task. During the process of the virtual instance executing the test cases corresponding to the target subtask, the execution status of the target subtask can be monitored. Specifically, the execution status of multiple steps included in the target subtask can be monitored, and the execution status of the target subtask can be recorded, such as the execution status of each step of the target subtask. Correspondingly, the execution status of the target subtask can be obtained. If the execution status of the target subtask is abnormal, other test cases (defined as target test cases) on which the test cases corresponding to the target subtask depend can be determined. Further, resource allocation can be re-performed on the target subtask with an abnormality and the subtasks corresponding to the target test cases, and the subtasks corresponding to the target test cases and the target subtask with an abnormality can be scheduled to their respective re-assigned resources in sequence. The resources re-assigned to the abnormal target subtask and the subtasks corresponding to the target test cases respectively can execute the test cases corresponding to the target test cases and the abnormal target subtask, thereby implementing recovery of the failed test cases. Specifically, the target test cases are executed first, and then the test cases corresponding to the target subtask with an abnormality are executed. Since the test cases corresponding to the subtask with an abnormality depend on the target test cases, therefore, by executing the target test cases first and then the test cases corresponding to the subtask with an abnormality, it can be ensured that the test cases corresponding to the subtask with an abnormality can be executed smoothly. This embodiment can capture the subtask with an abnormal execution with the help of the real-time monitoring mechanism of the monitoring tool and recover the subtask with an abnormal execution, ensuring test availability and reliability.
[0116] In the embodiments of the present application, in order to prevent subtasks from "starving" due to long-term waiting for scheduling, an anti-"starvation" mechanism is proposed. Specifically, for any of the foregoing target subtasks D, the waiting time of the target subtask D can be timed. Specifically, after the test task is split into multiple subtasks, the waiting times of the multiple subtasks can be timed respectively. Further, if the target subtask D has not been scheduled after exceeding the set waiting duration, it is queried whether the resources allocated to the target subtask D are in an idle state. If the resources allocated to the target subtask D are in an idle state, the target subtask D is scheduled to the resources allocated to the target subtask D to execute the test case corresponding to the target subtask D by using the resources allocated to the target subtask D. If the resources allocated to the target subtask D are in an occupied state, the target subtask D is written into the set second message queue and waits for scheduling.
[0117] In order to prevent the subtasks in the second message queue from starving, it is also possible to monitor the usage status of the resources respectively allocated to the subtasks of the foregoing multiple test tasks, and in the case where there are idle resources among the resources respectively allocated to the subtasks of the multiple test tasks, search in the second message queue for the subtasks whose allocated resources match the idle resources. The allocated resources matching the idle resources specifically means that the resource specifications of the idle resources are the same as the resource specifications of the resources allocated to the subtasks. Further, the target subtask matching the idle resources can be scheduled to the idle resources. The idle resources can execute the test case corresponding to the desired subtask. This embodiment can effectively prevent the situation where some subtasks "starve" due to not being scheduled for a long time. On the other hand, by dynamically monitoring the usage status of resources and scheduling the waiting subtasks in a timely manner when idle resources are found, the overall utilization rate of resources is improved and resource waste is reduced.
[0118] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can also be executed by different devices as the execution subject. For example, the execution subjects of steps 1101 and 1102 can be device A; for another example, the execution subject of step 1101 can be device A, and the execution subject of step 1102 can be device B; and so on.
[0119] In addition, in some of the processes described in the above embodiments and the accompanying drawings, there are multiple operations that appear in a specific order, but it should be clearly understood that these operations can be executed not in the order in which they appear in this article or in parallel. The operation numbers such as 1101, 1102, etc. are only used to distinguish different operations, and the numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and these operations can be executed in sequence or in parallel.
[0120] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the test task scheduling method provided in the foregoing embodiments.
[0121] Among them, the computer-readable storage medium can be implemented by volatile or non-volatile or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, disk storage or other magnetic storage devices or any other non-transmission medium.
[0122] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by one or more processors, the one or more processors are caused to execute the steps in the test task scheduling method provided in the foregoing embodiments.
[0123] In the embodiments of the present application, the specific implementation form of the computer program product is not limited. In some embodiments, the computer program product can be implemented as an application (APP), applet, computer-side client, program module, plug-in, installation package, software development kit (SDK), optical disc image file (such as an ISO file), plug-in or software as a service (SaaS)-form software, etc., but not limited thereto.
[0124] A computer program product should be understood as capable of implementing each process or a combination of multiple processes in the above method flow by a computer program or instruction. Additionally, these computer programs or instructions can be applied to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices, such that the processors of the general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices can be implemented as devices for realizing the corresponding functions in the above method embodiments.
[0125] Figure 12 This is a schematic structural diagram of the scheduling device provided by the embodiments of the present application. As Figure 12 shown, the scheduling device may include: a task receiving and decomposing module 12a. Among them, the task receiving and decomposing module 12a is used to execute the steps 1101 - step 1103 and the specific implementation manners of steps 1101 - step 1103 provided in the foregoing embodiments, including but not limited to: test task receiving, test task storage, and test task decomposition, etc.
[0126] As Figure 12 shown, the scheduling device may further include: a resource allocation and task scheduling module 12b. The resource allocation and task scheduling module 12b is used for resource allocation, specifically executing the step of allocating resources to the target subtask according to the resource configuration information of the target test task to which the target subtask belongs and the specific implementation manner of this step provided in the foregoing embodiments. The resource allocation and task scheduling module 12b is also used for task scheduling, specifically executing the task priority in the resource allocation information of the target test task and the configuration information of the target test task provided in the foregoing embodiments, and scheduling the target subtask to the resources allocated to the target subtask and the specific implementation manner of this step.
[0127] In some embodiments, the resource allocation and task scheduling module 12b may further obtain the status of the resources allocated to each subtask and update each resource status, that is, "resource status update".
[0128] In some embodiments, the scheduling device may further include: a task execution and monitoring module 12c. Among them, the task execution and monitoring module 12c is used to schedule resources to execute the allocated target subtasks and monitor the execution status of the subtasks.
[0129] In some embodiments, the scheduling device may further include: an exception handling module 12d. Among them, the exception handling module 12d is used to perform recovery processing on the subtasks that are monitored to have exceptions. The specific manner of performing recovery processing on the subtasks with exceptions can refer to the relevant content of the foregoing embodiments and will not be elaborated here.
[0130] Figure 13 This is a schematic structural diagram of the electronic device provided by the embodiments of the present application. As Figure 13As shown, the electronic device includes: a memory 13a and a processor 13b. Among them, the memory 13a is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.
[0131] The processor 13b is coupled to the memory 13a and is used to execute the computer program for the steps in the test task scheduling method provided in the foregoing embodiments. For the specific implementation manners of each step, reference may be made to the relevant descriptions in the foregoing embodiments, which will not be elaborated herein.
[0132] In some alternative embodiments, as Figure 13 shown, the electronic device may further include: optional components such as a communication component 13c, a power supply component 13d, a display component 13e, and an audio component 13f. Figure 13 Only some components are schematically shown herein, which does not mean that the electronic device must include Figure 13 all the components shown Figure 13 herein, nor does it mean that the electronic device can only include
[0133] In addition, Figure 13 the components within the dashed box herein are optional components, rather than essential components, and can be determined according to the product form of the electronic device. The electronic device in this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a mobile phone, or an Internet of Things device; or it can be various server devices such as a traditional server, a cloud server, or a server cluster.
[0134] In the embodiments of the present application, the memory is used to store computer programs and can be configured to store various other data to support operations on the device where it is located. Among them, the processor can execute the computer program stored in the memory to implement corresponding control logic. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), electrically erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disc.
[0135] In the embodiments of the present application, the processor may be any hardware processing device capable of executing the above method logic. Optionally, the processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), or a Microcontroller Unit (MCU); it may also be a programmable device such as a Field-Programmable Gate Array (FPGA), a Programmable Array Logic (PAL), a General Array Logic (GAL), or a Complex Programmable Logic Device (CPLD); or an Advanced Reduced Instruction Set Compute (RISC) processor (Advanced RISC Machines, ARM) or a System on Chip (SoC), etc., but not limited thereto.
[0136] In the embodiments of the present application, the communication component is configured to facilitate communication between the device where it is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on a communication standard, such as 2G or 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel.
[0137] In the embodiments of the present application, the display component may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the display component includes a touch panel, the display component can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation.
[0138] In the embodiments of the present application, the power supply component is configured to provide power to various components of the device where it is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.
[0139] In the embodiments of the present application, the audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC). When the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signals may be further stored in a memory or sent via a communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals. For example, for a device with a language interaction function, voice interaction with the user can be implemented through the audio component, etc.
[0140] It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are of different types.
[0141] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device including a series of elements not only includes those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, commodity or device including the above elements.
[0142] The above content is only for the embodiments of the present application and is not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A test task scheduling method, applicable to any scheduling node in a distributed scheduling system, characterized in that, The method includes: Obtaining a test task; Decomposing the test task into multiple subtasks according to the configuration information of the test task; Sending the multiple subtasks to a task allocation node for the task allocation node to allocate the multiple subtasks to multiple scheduling nodes for parallel resource scheduling.
2. The method according to claim 1, wherein The decomposing the test task into multiple subtasks according to the configuration information of the test task includes: Obtaining the configuration information of the multiple test suites from the configuration information of the test task; Decomposing the test suite into multiple subtasks according to the configuration information of the test suite.
3. The method according to claim 2, wherein The test task includes multiple test suites; The method further includes: Obtaining the resource allocation policies corresponding to the multiple test suites from the configuration information of the test task; The decomposing the multiple test suites into multiple subtasks according to the configuration information of the multiple test suites includes: Determining the test cases included in each of the multiple test suites from the test task according to the configuration information of the multiple test suites; For any test suite, determining the resource allocation policy corresponding to the test cases included in the any test suite according to the resource allocation policy corresponding to the any test suite; Dividing the test cases corresponding to the same resource allocation policy under the same test suite into the same subtask to obtain multiple subtasks corresponding to the test task.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: For at least one target subtask obtained, obtaining the resource allocation policy and resource specification information corresponding to the target test task from the configuration information of the target test task to which the at least one target subtask belongs; Allocating resources to the at least one target subtask according to the resource allocation policy and resource specification information corresponding to the target test task to obtain the resource allocation information of the at least one target subtask; Scheduling the at least one target subtask to the resources allocated to the at least one target subtask respectively according to the resource allocation information of the target test task and the task priority in the configuration information of the target test task, so as to execute the test cases corresponding to the at least one target subtask respectively by using the resources allocated to the at least one target subtask respectively.
5. The method according to claim 4, characterized in that, Any target test task to which a target subtask belongs includes at least one test suite; the any target subtask corresponds to the target test suite in the at least one test suite; The allocating resources to the any target subtask according to the resource allocation policy and resource specification information corresponding to the target test task includes: When the resource allocation policy includes a configuration creation policy, obtaining the resource specification information corresponding to the target test suite from the resource specification information corresponding to the target test task to which the any target subtask belongs; Creating a virtual instance according to the resource specification information corresponding to the target test suite; Allocating the any target subtask to the virtual instance.
6. The method according to claim 4, wherein Any test task includes at least one test suite; the resource allocation policy is an inherent virtual instance allocation policy; any target subtask corresponds to the target test suite in the at least one test suite; Allocating resources for the at least one target subtask according to the resource allocation information in the configuration information of the target test task to which each of the at least one target subtasks belongs, includes: The inherent virtual instance allocation policy includes: the identifiers of the virtual instances specified by each of the at least one test suites; for any one of the target subtasks, when the resource allocation policy corresponding to the target test task to which the any one of the target subtasks belongs is the inherent virtual instance allocation policy, allocating the any one of the target subtasks to the inherent virtual instance corresponding to the identifier of the virtual instance specified by the target test suite; Or, The resource specification information corresponding to each of the at least one test suites; when the resource allocation policy corresponding to the target test task to which the any one of the target subtasks belongs is the inherent virtual instance allocation policy, allocating the any one of the target subtasks to the inherent virtual instance adapted to the resource specification information corresponding to the target test suite.
7. The method according to claim 4, wherein The resource allocation information includes: the identifier of the virtual instance to which the target subtask is allocated; scheduling the at least one target subtask to the resources allocated to each of the at least one target subtasks according to the resource allocation information and the task priority in the configuration information of the target test task, includes: Determining the target subtasks allocated to the same virtual instance according to the identifier of the virtual instance to which the at least one target subtask is allocated; Scheduling the target subtasks allocated to the same virtual instance to the target virtual instance in sequence according to the task priorities of the test tasks to which the target subtasks allocated to the same virtual instance belong; the target virtual instance refers to the virtual instance to which the target subtasks allocated to the same virtual instance are allocated.
8. The method according to claim 7, wherein Scheduling the target subtasks allocated to the same virtual instance to the target virtual instance in sequence according to the task priorities of the test tasks to which the target subtasks allocated to the same virtual instance belong, includes: Determining the execution order of the target subtasks allocated to the same virtual instance according to the task priorities of the test tasks to which the target subtasks allocated to the same virtual instance belong; Establishing a linked list of the target subtasks allocated to the same virtual instance according to the execution order; Scheduling the target subtasks allocated to the same virtual instance to the target virtual instance in sequence according to the linked list.
9. The method according to claim 8, wherein Before scheduling the target subtasks allocated to the same virtual instance to the target virtual instance in sequence according to the linked list, the method further includes: Storing the linked list in a memory-based data structure storage system; Reading the linked list from the data structure storage system when the target virtual instance is idle.
10. The method according to claim 7, characterized in that During the process of scheduling the target subtasks allocated to the same virtual instance to the target virtual instance in sequence, includes: For any currently scheduled target subtask in the target subtasks assigned to the same virtual instance, split the any target subtask into multiple steps according to the resource allocation policy corresponding to the target test suite corresponding to the any target subtask and the environment configuration information of the target test task to which the any target subtask belongs; According to the sequence of the multiple steps, schedule the multiple steps to the target virtual instance in sequence, so as to schedule the any target subtask to the target virtual instance.
11. The method according to claim 10, wherein, Before scheduling the multiple steps to the target virtual instance in sequence according to the sequence of the multiple steps, the method further includes: Send the multiple steps to the task assignment node to which they belong, so that the task assignment node distributes the multiple steps to the multiple scheduling nodes; For any one of the multiple scheduling nodes, the scheduling the multiple steps to the target virtual instance in sequence according to the sequence of the multiple steps includes: In response to the trigger operation of the task assignment node, schedule the steps assigned to the any scheduling node to the target virtual instance; the task assignment node triggers the multiple scheduling nodes in sequence according to the sequence of the multiple steps to perform resource scheduling for the multiple steps, so that the multiple scheduling nodes schedule the multiple steps to the same virtual instance in sequence according to the sequence of the multiple steps.
12. The method according to claim 4, wherein Further includes: Obtain the execution status of any target subtask; If the execution status of the any target subtask is abnormal, determine the target test case on which the test case corresponding to the any target subtask depends; Reschedule the resources for the any target subtask and the subtasks corresponding to the target test case, and sequentially execute the target test case and the test cases corresponding to the any subtask by using the rescheduled resources.
13. The method according to claim 4, wherein Further includes: For any target subtask, if the any target subtask is not scheduled after exceeding the set waiting duration, query whether the resources assigned to the any target subtask are in an idle state; In the case where the resources assigned to the any target subtask are in an occupied state, write the any target subtask into a set message queue; In the case where it is monitored that there are idle resources among the resources respectively assigned to the subtasks of the multiple test tasks, find the subtasks whose assigned resources are adapted to the idle resources from the message queue; Schedule the subtasks adapted to the idle resources to the idle resources, so as to execute the test cases corresponding to the subtasks adapted to the idle resources by using the idle resources.
14. A distributed scheduling system, characterized in that, Includes: Multiple scheduling nodes and a task assignment node; The multiple scheduling nodes are used to execute the steps in any one of claims 1-13; The task assignment node is used to distribute the multiple subtasks obtained by disassembling the test task to the multiple scheduling nodes; The multiple scheduling nodes are further used to perform parallel resource scheduling on the multiple subtasks.
15. An electronic device, characterized in that, Includes: A memory and a processor; wherein, the memory is used to store a computer program; The processor is coupled to the memory and configured to execute the computer program for performing the steps in the method according to any one of claims 1-13.
16. A computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed by one or more processors, the one or more processors are caused to perform the steps in the method according to any one of claims 1-13.
17. A computer program product, characterized in that, Comprising a computer program which, when executed by one or more processors, causes the one or more processors to perform the steps in the method according to any one of claims 1-13.
Citation Information
Patent Citations
Resources allocation method and device, readable medium and electronic equipment
CN114020470A
Virtual machine batch creation method and device, electronic equipment and storage medium
CN114327761A
Resource scheduling method, device and equipment
CN117149401A
Task scheduling method and device, task submission method and device, equipment and medium
CN117201496A
Task construction method and device, electronic equipment and storage medium
CN117707761A
Cited By
CAE software-oriented test method, apparatus and device, and storage medium
CN120803959A
A test method, device and equipment for CAE software and a storage medium
CN120803959B
