CN112988494A - Abnormity testing method and device and electronic device - Google Patents

Abnormity testing method and device and electronic device Download PDF

Info

Publication number
CN112988494A
CN112988494A CN202110277415.3A CN202110277415A CN112988494A CN 112988494 A CN112988494 A CN 112988494A CN 202110277415 A CN202110277415 A CN 202110277415A CN 112988494 A CN112988494 A CN 112988494A
Authority
CN
China
Prior art keywords
service
verified
stability
abnormal
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110277415.3A
Other languages
Chinese (zh)
Inventor
倪卫杰
林金烈
周明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202110277415.3A priority Critical patent/CN112988494A/en
Publication of CN112988494A publication Critical patent/CN112988494A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing

Abstract

The embodiment of the disclosure provides an anomaly testing method, equipment and electronic equipment, wherein the method comprises the following steps: acquiring a service to be verified and a dependent service corresponding to the service to be verified, and acquiring an abnormal event corresponding to the service to be verified; injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified; test result information is generated according to the stability state corresponding to the service to be verified, automatic execution of the chaotic engineering experiment process is achieved, automatic determination of the experiment result is achieved, the experiment process does not need to be executed manually, the experiment result does not need to be determined manually, time required for determining the experiment result is shortened, time required for conducting the chaotic engineering experiment is shortened, labor cost can be reduced, experiment cost required by the chaotic engineering experiment can be reduced, and user experience is improved.

Description

Abnormity testing method and device and electronic device
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to an anomaly testing method, an anomaly testing device and an electronic device.
Background
Chaos Engineering (Chaos Engineering) is the discipline of conducting experiments on distributed systems with the aim of establishing the ability of the system to resist out-of-control conditions in the production environment.
In the prior art, when performing a chaos engineering experiment, generally, related personnel inject a fault into a dependent service corresponding to a service to be verified, and observe a stability condition of the service to be verified after injecting the fault into the dependent service, so as to determine an experimental result by using the stability condition.
However, because the chaos engineering experiment process needs to be manually executed and the experiment result of the chaos engineering experiment needs to be manually determined, the time required for determining the experiment result is long, and the experiment cost required by the chaos engineering experiment is high.
Disclosure of Invention
The embodiment of the disclosure provides an anomaly testing method, equipment and electronic equipment, and aims to solve the problem that the time required for determining an experimental result of a chaotic engineering experiment is long.
In a first aspect, an embodiment of the present disclosure provides an anomaly testing method, including:
acquiring a service to be verified and a dependent service corresponding to the service to be verified, and acquiring an abnormal event corresponding to the service to be verified;
injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified;
and generating test result information according to the stability state corresponding to the service to be verified.
In a second aspect, an embodiment of the present disclosure provides an anomaly testing apparatus, including:
the system comprises an information acquisition module, a verification module and a verification module, wherein the information acquisition module is used for acquiring a service to be verified and a dependent service corresponding to the service to be verified and acquiring an abnormal event corresponding to the service to be verified;
the processing module is used for injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified;
the processing module is further configured to generate test result information according to the stability state corresponding to the service to be verified.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory.
The memory stores computer-executable instructions.
The at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the anomaly testing method as described above in the first aspect and in various possible designs of the first aspect.
In a fourth aspect, the embodiments of the present disclosure provide a computer-readable storage medium, where computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the anomaly testing method according to the first aspect and various possible designs of the first aspect is implemented.
In a fifth aspect, the embodiments of the present disclosure provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the anomaly testing method according to the first aspect and various possible designs of the first aspect is implemented.
The method comprises the steps of obtaining a service to be verified and a dependent service corresponding to the service to be verified, and obtaining an abnormal event corresponding to the service to be verified; injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified; and generating test result information according to the stability state corresponding to the service to be verified. The embodiment of the disclosure determines the service to be verified, i.e. the service to be verified, and obtains the dependent service corresponding to the service to be verified, i.e. the service associated with the service to be verified, so as to determine the stability of the service to be verified by using the service, when performing an anomaly test, i.e. when performing a chaos engineering experiment. After the dependent service corresponding to the service to be verified is obtained, the abnormal event is injected into the dependent service, the stability change of the service to be verified is monitored, the stability state corresponding to the service to be verified is obtained, the automatic determination of the stability state is realized, corresponding test result information is generated according to the stability state corresponding to the service to be verified, the experimental result of the chaotic engineering experiment is obtained, the automatic execution of the chaotic engineering experimental process is realized, the automatic determination of the experimental result is realized, the experimental process does not need to be executed manually, the experimental result does not need to be determined manually, the time for determining the experimental result is shortened, the time for performing the chaotic engineering experiment is shortened, the labor cost is reduced, the experimental cost required by the chaotic engineering experiment can be reduced, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a scene schematic diagram of an anomaly testing method provided by the embodiment of the present disclosure;
fig. 2 is a first schematic flow chart of an anomaly testing method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a service to be authenticated provided by an embodiment of the present disclosure;
fig. 4 is a schematic flow chart diagram of an anomaly testing method according to an embodiment of the present disclosure;
fig. 5 is a schematic flow chart of an anomaly testing method according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of an exception testing apparatus provided in the embodiments of the present disclosure;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The existing chaos engineering construction schemes are generally Fault Injection Testing (FIT) and automated chaos engineering experiment platforms. The fault injection test platform is a primary stage construction scheme of chaotic engineering.
In the prior art, when a fault injection test platform performs a chaotic engineering experiment and injects a fault into a dependent service corresponding to a service to be verified, relevant personnel judge the stability state of the service to be verified by observing a stability index of the service to be verified and determine a corresponding result according to the stability state. However, the experiment process needs to be manually executed, and the experiment result needs to be manually determined, so that the time required by the experiment is long, and the time required by the experiment result determination is long. Meanwhile, since the service has its own stability observation index and does not have universality, when there are a plurality of services to be verified, related personnel are required to be familiar with the stability observation indexes corresponding to different services to be verified so as to determine the stability state of each service to be verified according to the stability observation indexes corresponding to different services to be verified, which results in complex stability state judgment.
Therefore, in order to solve the above problems, the technical idea of the present invention is to provide a chaos engineering transition phase construction scheme, so as to upgrade a fault injection test platform to an automated chaos engineering experiment platform, which can automatically execute a chaos engineering experiment procedure, so as to automatically execute the chaos engineering experiment procedure, reduce the time required by the experiment, automatically determine the experiment result, and reduce the time required by the experiment result determination, thereby reducing the chaos engineering experiment cost. Meanwhile, a universal stability index is defined, namely the stability states of different services can be determined through the stability index, so that the stability states of the services can be rapidly and accurately determined.
Fig. 1 is a scene schematic diagram of an anomaly testing method according to an embodiment of the present invention, and as shown in fig. 1, when a chaotic engineering experiment is performed on a business system based on an electronic device 101, a service to be verified in the business system and a dependent service corresponding to the service to be verified are obtained, and a fault is injected into the dependent service to determine a stability condition of the service to be verified, so that a corresponding experiment result is generated according to the stability condition, and the experiment result is output.
The electronic device 101 may be a computer device (e.g., a desktop, a notebook, a kiosk, etc.), a server, or the like. Specifically, the electronic device 101 is a device including a chaos engineering experiment platform.
Referring to fig. 2, fig. 2 is a schematic flow chart of an anomaly testing method according to an embodiment of the present disclosure. The method of the embodiment can be applied to electronic equipment, in particular to a chaotic engineering experiment platform applied to the electronic equipment, and the anomaly testing method comprises the following steps:
s201: and acquiring the service to be verified and the corresponding dependent service thereof, and acquiring the abnormal event corresponding to the service to be verified.
In the embodiment of the disclosure, in order to improve the reliability and stability of the service system, a chaos engineering experiment is performed on the service system to test whether the system has defects, and the performance of the service system under a chaotic condition is determined, so that the service system is improved to improve the reliability and stability of the service system. When chaotic engineering experiments are carried out on a business system, the experiments are carried out based on services provided by the business system, namely, a to-be-verified service identifier corresponding to the business system is determined, the service corresponding to the to-be-verified service identifier is the to-be-verified service, a dependent service identifier corresponding to the to-be-verified service identifier is obtained, and the service corresponding to the dependent service identifier is the dependent service corresponding to the to-be-verified service.
The service to be verified is a service which needs to verify stability in the system. The dependent service corresponding to the service to be verified represents a service which has a dependent relationship with the service to be verified in the services provided by the business system.
Optionally, the dependent service corresponding to the service to be verified is a downstream dependent service of the service to be verified.
Optionally, when the to-be-verified service identifier corresponding to the system is determined, the to-be-verified service identifier may be directly obtained from the first preset location, or the to-be-verified service identifier may be determined based on an application scenario, that is, an experimental scenario selected by a relevant person is obtained, and an identifier of a service related to the scenario is used as the to-be-verified service identifier.
The experimental scene has universality, can meet the requirements for building a high-availability toughness business system, and comprises a strong and weak dependency relationship scene of a service call chain, a scene for verifying whether the timeout time of service call is reasonable and the like.
Further, optionally, the first preset location includes a storage location such as a hard disk, a data table, and a database, which is not limited in this disclosure.
Optionally, the identifier of the service to be verified is a unique identifier such as a name and a number of the service to be verified. Correspondingly, the dependent service identifier corresponding to the service identifier to be verified may also be a unique identifier such as a name and a number of the dependent service.
Optionally, when the dependent service identifier corresponding to the service identifier to be verified is obtained, for each service identifier to be verified, the dependent service identifier corresponding to the service identifier to be verified is searched from the preset verification dependent service mapping table, so that the dependent service corresponding to the service identifier to be verified can be determined.
In the embodiment of the disclosure, when the chaos engineering experiment is performed, fault injection is required, and therefore, if a fault to be injected, namely an abnormal event, needs to be determined, an abnormal event identifier corresponding to a service identifier to be verified is searched, so that the determination of the abnormal event is realized.
Further, optionally, when the abnormal event identifier corresponding to the service identifier to be verified is searched, for each dependent service identifier corresponding to the service identifier to be verified, the abnormal event identifier corresponding to the dependent service identifier is searched, so as to determine the abnormal event that needs to be injected into the dependent service corresponding to the dependent service identifier.
The exception events corresponding to each dependent service may be the same or different, and are not limited by this disclosure.
The abnormal event type can be selected according to actual conditions, and comprises types such as service rejection, packet loss or time delay.
S202: and injecting the abnormal event into the dependent service corresponding to the service to be verified so as to determine the stability state corresponding to the service to be verified.
In the embodiment of the disclosure, after determining the dependent service corresponding to the service to be verified and the abnormal event corresponding to the service to be verified, for each dependent service corresponding to the service to be verified, the abnormal event is injected into the dependent service, and the stability of the service to be verified is determined, so that the stability state corresponding to the service to be verified and the dependent service is obtained, that is, a stability state corresponding to the service to be verified is obtained.
In addition, optionally, when each dependent service corresponding to the service to be verified has its corresponding exception event, when the exception event is injected into the dependent service, the exception event corresponding to the dependent service is injected into the dependent service.
Optionally, the stable state includes a stable state and an unstable state.
Specifically, when the stability state corresponding to the service to be verified is a stable state, it indicates that after the abnormal event is injected into the dependent service, that is, when the dependent service is abnormal, the service to be verified is still stable, that is, it can still run.
Specifically, when the stability state corresponding to the service to be verified is an instability state, it indicates that after the abnormal event is injected into the dependent service, that is, when the dependent service is abnormal, the service to be verified is unstable, that is, the service to be verified cannot normally operate.
S203: and generating test result information according to the stability state corresponding to the service to be verified.
In the embodiment of the disclosure, after all the stability states corresponding to the service to be verified are obtained, corresponding test result information is generated according to each stability state corresponding to the service to be verified, and the test result information is output, so that relevant personnel can determine whether the system has problems according to the test result information, and determine whether the system needs to be improved, thereby ensuring the reliability and stability of the system.
Optionally, the test result information includes a verification result corresponding to the service to be verified. When the experimental scenarios are different, the verification results corresponding to the services to be verified, which are determined according to the stability states corresponding to the services to be verified, are different, for example, when the experimental scenarios are strong and weak dependency scenarios of the service call chain, it is indicated that the strong and weak dependency between the services to be verified and the dependent services corresponding thereto need to be determined, and the verification results corresponding to the services to be verified are the dependency between the services to be verified and the dependent services corresponding thereto, where the dependency includes strong dependency and weak dependency.
For example, as shown in fig. 3, service 1 is a service to be authenticated, and service a and service b are respectively downstream dependent services of service 1. When the abnormal event is injected into the service a, if the stability state of the service 1 is a stable state, it is determined that the service 1 and the service a are weakly dependent, that is, a verification result corresponding to the service to be verified is obtained as a weak dependency between the service 1 and the service a. When the abnormal event is injected into the service b, if the stability state of the service 1 is an unstable state, it is determined that the service 1 and the service b are strongly dependent, that is, a verification result corresponding to the service to be verified is obtained as the strong dependence between the service 1 and the service b.
As can be seen from the above description, when performing an anomaly test, that is, when performing a chaos engineering experiment, a service to be verified, that is, a service to be verified is determined, and a dependent service corresponding to the service to be verified, that is, a service associated with the service to be verified is obtained, so as to determine the stability of the service to be verified by using the service. After the dependent service corresponding to the service to be verified is obtained, the abnormal event is injected into the dependent service, the stability change of the service to be verified is monitored, the stability state corresponding to the service to be verified is obtained, the automatic determination of the stability state is realized, corresponding test result information is generated according to the stability state corresponding to the service to be verified, the experimental result of the chaotic engineering experiment is obtained, the automatic execution of the chaotic engineering experimental process is realized, the automatic determination of the experimental result is realized, the experimental process does not need to be executed manually, the experimental result does not need to be determined manually, the time for determining the experimental result is shortened, the time for performing the chaotic engineering experiment is shortened, the labor cost is reduced, the experimental cost required by the chaotic engineering experiment can be reduced, and the user experience is improved.
Referring to fig. 4, fig. 4 is a schematic flow chart of an anomaly testing method according to an embodiment of the present disclosure. In this embodiment, a process of determining a stability state of a service to be verified by using a change condition of a stability indicator after an abnormal event is injected into a dependent service corresponding to the service to be verified is described in detail, where the bandwidth measurement method includes:
s401: and acquiring the service to be verified and the corresponding dependent service thereof, and acquiring the abnormal event corresponding to the service to be verified.
In the embodiment of the disclosure, when an abnormal test is performed, that is, when a chaotic engineering experiment is performed, network traffic required for performing the experiment needs to be constructed, test environment information is acquired, and a traffic construction scheme corresponding to the test environment information is acquired. And carrying out network flow construction operation based on the flow construction scheme to obtain the flow of the test environment and realize construction of the experimental flow.
Wherein, when the chaos engineering experiment is carried out, the experiment can be carried out in an on-line environment or an on-line environment. Correspondingly, the test environment information comprises an online environment identifier and/or an offline environment identifier.
Specifically, when the test environment information is an offline environment identifier, it indicates that the chaotic engineering experiment is performed in an online offline environment, and the chaotic engineering experiment does not affect the stability of an online system or the experience of a user, a flow construction scheme corresponding to the offline environment is obtained, so as to construct the flow required by the experiment based on the flow construction scheme corresponding to the offline environment, for example, based on the flow construction scheme, an automated test platform is used to execute a test case to generate a test flow, thereby implementing the construction of a network flow.
Specifically, when the test environment information is an online environment identifier, it indicates that the chaotic engineering experiment is performed in an online environment. Because the online environment is the environment really used by the user, the influence range of the experiment, namely the explosion radius, needs to be controlled, the flow needs to be screened, and the flow required by the flow construction scheme construction experiment corresponding to the online environment is obtained, so that the flow screening is realized. For example, based on the flow construction scheme, the flow is divided according to a front-end platform to realize the screening of the experimental flow; as another example, clusters (e.g., cardinal publishing clusters) are deployed based on the traffic construction scheme to screen traffic through the clusters.
It will be appreciated that in constructing the flow based on the flow construction scheme, it is the practice to perform the operational steps involved in the flow construction scheme to achieve the constructed screening of the flow.
In the embodiment of the present disclosure, after the experimental flow, that is, the test environment flow is configured, the actual size of the configured test environment flow may not be the flow size of the required configuration, that is, the target flow size, and therefore, it is necessary to determine whether the actual size of the test environment flow is the target flow size, so as to determine whether the size of the test environment flow needs to be adjusted, if the size of the test environment flow is not equal to the target flow size, it indicates that the obtained actual size of the test environment flow is not the target flow size, the test environment flow is adjusted to adjust the size of the test environment flow to the target flow size, that is, the size of the adjusted test environment flow is the target flow size.
Optionally, if the size of the test environment flow is equal to the size of the target flow, it is indicated that the actual size of the obtained test environment flow is already the size of the target flow, and no adjustment is needed.
Taking a specific application scenario as an example, the experimental environment is an online environment, the canary release cluster is deployed through a flow construction scheme corresponding to the online environment, and the flow in the canary release cluster is the test environment flow, namely the experimental flow, so that the construction, namely the screening, of the experimental flow is realized. The target flow size corresponding to the testing environment flow is 100kbs, and the flow size in the constructed canary release cluster, namely the size of the testing environment flow is 90kbs, so that the size of the testing environment flow needs to be adjusted from 90kbs to 100 kbs.
In addition, optionally, after the size of the test environment traffic is adjusted, after the verification result corresponding to the service to be verified is determined, the service to be verified also needs to be recovered. Specifically, the size of the test environment traffic before adjustment is used as the initial traffic size, and after the verification result corresponding to the service to be verified is determined, the current size of the test environment traffic is adjusted to the initial traffic size.
And carrying out the application scene, and after determining a verification result corresponding to the service to be verified, restoring the flow scale in the canary release cluster to 90 kbs.
S402: and after the abnormal event is injected into the dependent service corresponding to the service to be verified, acquiring the stability index information corresponding to the service to be verified.
In the embodiment of the present disclosure, for each dependent service corresponding to a service to be verified, after injecting an abnormal event into the dependent service, monitoring a change condition of a stability index to obtain a plurality of stability index values, that is, stability index information corresponding to the service to be verified and the dependent service is obtained, so that a stability state of the service to be verified can be determined by analyzing the stability index information, and then a dependency relationship between the service to be verified and the dependent service is determined.
The stability index is a general service stable state description index, and different types of services can use the stability index as their own stability observation index, for example, the stability index is service response time and consumed traffic.
The stability index information corresponding to the service to be verified comprises a plurality of stability index values. Optionally, the stability index information may further include a time corresponding to the stability index value, i.e., a time for generating the stability index value.
S403: and determining the stability state corresponding to the service to be verified according to the stability index information corresponding to the service to be verified.
In the embodiment of the disclosure, after stability index information corresponding to the dependent service and the to-be-verified service is obtained for each dependent service corresponding to the to-be-verified service, the stability index information is analyzed to determine the stability state of the to-be-verified service when the dependent service fails, that is, the stability state corresponding to the to-be-verified service is obtained.
In this disclosure, optionally, the implementation manner of S403 includes:
it is determined whether an anomaly index value exists in the plurality of stability index values.
And if the abnormal index value exists, determining that the stability state corresponding to the service to be verified is an unstable state.
And if the abnormal index value does not exist, determining that the stability state corresponding to the service to be verified is a stable state.
Specifically, when the stability index information is analyzed, it is determined whether an abnormal index value exists in all stability index values included in the stability index information, and if an abnormal index value exists, it indicates that after an abnormal time is injected into a dependent service corresponding to a service to be verified, that is, after the dependent service is abnormal, the service to be verified is also abnormal, that is, the service to be verified is unstable, it is determined that the stability state corresponding to the service to be verified is an unstable state. If the stability index values do not exist in all the stability index values, the fact that after the abnormal time is injected into the dependent service corresponding to the service to be verified, namely after the dependent service is abnormal, the service to be verified is not abnormal and still runs normally is indicated, and the stability state corresponding to the service to be verified is determined to be a stable state.
Further, optionally, when determining whether there is an abnormal index value in the plurality of stability index values, the determination may be performed in the following two ways.
One way is as follows: a stability curve is generated based on the plurality of stability index values. And if the stability curve does not have the abnormal curve segment, determining that the abnormal index value does not exist in the stability index values. And if the stability curve has an abnormal curve segment, determining that an abnormal index value exists in the stability index values.
In the embodiment of the present disclosure, a corresponding curve is generated based on a plurality of stability index values included in the stability index information to obtain a stability curve, whether the stability curve has an abnormal curve segment is determined, when the abnormal curve segment exists, it indicates that the stability curve does not change steadily, and a curve segment in an abnormal rising state or an abnormal falling state exists, that is, there are suddenly increased or decreased stability index values, and it is determined that there is an abnormal index value in the plurality of stability index values.
When the stability curve has no abnormal curve segment, the stability curve is indicated to be changed smoothly, and no curve segment in an abnormal rising state or an abnormal falling state exists, namely the stability index value is changed less, and the stability index value is determined to be absent in the stability index values.
The abnormal curve segment is a curve segment with the slope absolute value larger than a preset value. Since the curve is steeper as the absolute value of the slope of the curve is larger, the curve section is steep, i.e., the curve section takes a suddenly rising state, i.e., an abnormally rising state, or a suddenly falling state, i.e., an abnormally falling state, when the absolute value of the slope of the curve section is larger than a preset value.
The preset value can be set according to actual conditions, and the disclosure does not limit the preset value.
In addition, optionally, when the stability curve is generated, one coordinate point is assigned to each stability index value coordinate, and the coordinate points are labeled in a preset coordinate system, and curve fitting is performed on the coordinate points in the preset coordinate system, so as to obtain a corresponding stability curve.
The ordinate of the preset coordinate system is a stability index, and the abscissa may be set according to an actual situation, for example, time, i.e., time corresponding to the stability index value, is taken as the abscissa.
In addition, the slope of the curve segment may be the slope of a certain coordinate point on the stability curve, or may be the slope determined based on two adjacent coordinate points on the stability curve.
The other mode is as follows: a difference between adjacent ones of the plurality of stability indicator values is obtained. And if the difference values between all the adjacent stability index values are within the preset difference value range, determining that no abnormal index value exists in the plurality of stability index values. And if the difference value between the adjacent stability index values is not within the preset difference value range, determining that an abnormal index value exists in the plurality of stability index values.
Specifically, a difference between any two adjacent stability index values in the stability index information is calculated, and if all the differences are within a preset difference range, it is indicated that the stability index value changes less, that is, the stability index value changes steadily, it is determined that no abnormal index value exists in the plurality of stability index values included in the stability index information. And if the difference value is not in the preset difference value range, the stability index value which shows the existence of the sudden increase or the sudden decrease, namely the stability index value which has larger change exists, determining that the abnormal index value exists in the stability index values.
S404: and generating test result information according to the stability state corresponding to the service to be verified.
In the embodiment of the disclosure, for each dependent service corresponding to the service to be verified, after an abnormal event is injected into the dependent service, that is, after a fault is injected into the dependent service, the stability of the service to be verified is determined based on the stability index value, that is, the stability state corresponding to the service to be verified is obtained. And if the stability state corresponding to the service to be verified is a stable state, which indicates that the service to be verified can still stably run even if the service to be relied on is abnormal, determining that the verification result corresponding to the service to be verified is a weak dependence result, namely determining that the service to be verified depends on the dependence service. If the stability state corresponding to the service to be verified is an unstable state, which indicates that the service to be verified cannot stably run when the service to be verified is abnormal, determining that the verification result corresponding to the service to be verified is a strong dependence result, that is, the service to be verified strongly depends on the dependent service.
In any of the disclosed embodiments, optionally, the test result information further includes result association data, where the result association data represents data associated with a verification result corresponding to the service to be verified, that is, context data of the verification result may be inferred. For example, if the verification result is that the dependency relationship between the service 1 and the service a is a strong dependency, the result association data includes an anomaly index value.
Further, optionally, after obtaining the verification result corresponding to the service to be verified, it may also be determined whether the verification result meets an expectation, and the specific process includes: and judging whether the verification result corresponding to the service to be verified is a standard result. And if the result is not the standard result, outputting modification prompt information. And if the result is a standard result, outputting a test completion prompt message.
Specifically, a standard result is obtained, and the standard result is a preset result. And comparing the verification result corresponding to the service to be verified with the standard result corresponding to the service to be verified, if the verification result is the same as the standard result, indicating that the verification result is in accordance with the expectation, outputting test completion prompt information to inform relevant personnel that the result of the chaotic engineering experiment performed by the relevant personnel is in accordance with the expectation, and ending the chaotic engineering experiment. If the two are different, the verification result is not in accordance with the expectation, modification prompt information is output to inform relevant personnel that the result of the chaotic engineering experiment carried out by the relevant personnel is not in accordance with the expectation, modification is needed, namely the experimental scheme and/or the system needs to be modified, so that the chaotic engineering experiment is carried out again after the modification until the finally obtained verification result is in accordance with the expectation.
For example, if the obtained verification result is weak dependency between the service 1 and the service a, but the standard result is strong dependency between the service 1 and the service a, it is determined that the verification result does not meet the standard result, and accordingly, modification prompt information is output.
It can be understood that the test completion prompt information is output only when all the verification results are determined to be the standard results, and the modification prompt information is output if the verification results are not the standard results.
In addition, optionally, since unpredictable conditions may occur during the chaos engineering experiment, and accordingly, the obtained verification result may also be unpredictable, that is, there is no corresponding standard result, so that after the test result information is obtained, relevant personnel may also evaluate whether the verification result in the test result information meets expectations.
In addition, optionally, modification information input by related personnel may also be stored, where the modification information includes modification progress information, modification schemes, reasons for problems, and the like.
The modification schedule information comprises different modification time and modification items corresponding to the modification time, and the modification items required to be completed in the modification time, so that the electronic equipment prompts related personnel to complete the corresponding modification items in the modification time based on the modification schedule, the condition that modification is not completed for a long time is avoided, and the time limit and the efficiency of modification completion are ensured.
The following describes a flow of a chaos engineering experiment by a specific application example, as shown in fig. 5, which includes:
1) and selecting an experimental target, namely determining an experimental scene through a chaos engineering experiment to determine the service needing stability verification and the corresponding service needing fault injection, such as dependent service.
2) And (4) experimental flow adjustment, namely after the experimental flow required by the chaotic engineering is constructed, adjusting the experimental flow to the required flow.
3) And injecting fault and stability detection, namely injecting abnormal events into the service to be injected with the fault, and determining the stability state of the service to be verified at the moment by using the stability index value.
4) And (4) recovering the flow, namely recovering the experimental flow to the size before adjustment.
5) And generating an experiment report, namely after determining the stability state of the service, generating a verification result based on the stability state, acquiring associated data related to the generation of the verification result, and generating the experiment report comprising the verification result and the associated data.
6) And (4) determining the experimental report, namely outputting the experimental report to enable relevant responsible personnel to confirm the experimental report so as to determine whether the system has problems.
7) And (3) repairing the system problem, namely when the system is determined to have the problem, repairing the system problem by related responsible personnel to ensure the stability and the usability of the system, and of course, automatically repairing the abnormality of the system.
In addition, the chaotic engineering experiment can also automatically execute the chaotic engineering experiment process at regular time.
In the embodiment of the disclosure, the stability index is a general index capable of describing a service stable state, and is unrelated to the architecture, framework and used development language of the system, when the service has no availability problem, the stability index is stable, and when the service or system has the availability problem, namely, is abnormal, the stability index has a sudden increase or decrease condition, so that the abnormality can be quickly embodied, and the observable capability of the chaotic engineering experiment is further satisfied.
In the embodiment of the disclosure, when the chaotic engineering experiment is performed in an online environment, the explosion radius of the experiment needs to be controlled, so that related personnel can screen flow according to actual time delay requirements, that is, the step of flow screening is determined, so as to obtain a corresponding flow construction scheme, so that the electronic device can screen out the required flow when screening the scheme based on the flow construction scheme, and when the chaotic engineering experiment is performed by using the flow, the influence range of the experiment can be ensured, and accidents, resource loss or influence on user experience are avoided.
In the embodiment of the disclosure, when an abnormal event is injected into a dependent service corresponding to a service to be verified so that the dependent service is abnormal, it is indicated that the stability condition of the service to be verified needs to be determined by using related monitoring data of the service to be verified, stability index information is obtained and analyzed to determine the stability condition of the service to be verified, that is, the stability state corresponding to the service to be verified is obtained, automatic and accurate determination of the service to be verified is realized, and determination efficiency and accuracy of the stability state of the service are improved.
Corresponding to the above described exception testing method, fig. 6 is a block diagram of an exception testing apparatus provided in the embodiment of the present disclosure. For ease of illustration, only portions that are relevant to embodiments of the present disclosure are shown. Referring to fig. 6, the abnormality test apparatus 60 includes: an information acquisition module 601 and a processing module 602.
The information obtaining module 601 is configured to obtain a service to be verified and a dependent service corresponding to the service to be verified, and obtain an abnormal event corresponding to the service to be verified.
The processing module 602 is configured to inject an exception event into a dependent service corresponding to a service to be verified, so as to determine a stability state corresponding to the service to be verified.
The processing module 602 is further configured to generate test result information according to the stability state corresponding to the service to be verified.
In an embodiment of the disclosure, the processing module 602 is further configured to:
and after the abnormal event is injected into the dependent service corresponding to the service to be verified, acquiring the stability index information corresponding to the service to be verified.
And determining the stability state corresponding to the service to be verified according to the stability index information corresponding to the service to be verified.
In an embodiment of the disclosure, if the stability index information corresponding to the service to be verified includes a plurality of stability index values, the processing module 602 is further configured to:
it is determined whether an anomaly index value exists in the plurality of stability index values.
And if the abnormal index value exists, determining that the stability state corresponding to the service to be verified is an unstable state.
And if the abnormal index value does not exist, determining that the stability state corresponding to the service to be verified is a stable state.
In an embodiment of the disclosure, the processing module 602 is further configured to:
a stability curve is generated based on the plurality of stability index values.
And if the stability curve does not have the abnormal curve segment, determining that the abnormal index value does not exist in the stability index values.
And if the stability curve has an abnormal curve segment, determining that an abnormal index value exists in the stability index values.
In one embodiment of the present disclosure, the abnormal curve segment is a curve segment having a slope with an absolute value greater than a preset value.
In an embodiment of the disclosure, the processing module 602 is further configured to:
a difference between adjacent ones of the plurality of stability indicator values is obtained.
And if the difference values between all the adjacent stability index values are within the preset difference value range, determining that no abnormal index value exists in the plurality of stability index values.
And if the difference value between the adjacent stability index values is not within the preset difference value range, determining that an abnormal index value exists in the plurality of stability index values.
In an embodiment of the disclosure, if the test result information includes a verification result corresponding to the service to be verified, the processing module 602 is further configured to:
and if the stability state corresponding to the service to be verified is a stable state, determining that the verification result corresponding to the service to be verified is a weak dependence result.
And if the stability state corresponding to the service to be verified is an unstable state, determining that the verification result corresponding to the service to be verified is a strong dependence result.
In an embodiment of the disclosure, the processing module 602 is further configured to:
and judging whether the verification result corresponding to the service to be verified is a standard result.
And if the result is not the standard result, outputting modification prompt information.
And if the result is a standard result, outputting a test completion prompt message.
In one embodiment of the present disclosure, the test result information includes a verification result corresponding to the service to be verified and result association data, where the result association data represents data associated with generating the verification result corresponding to the service to be verified.
In an embodiment of the disclosure, the processing module 602 is further configured to:
and acquiring the test environment information and acquiring a flow construction scheme corresponding to the test environment information.
And carrying out network traffic construction operation based on the traffic construction scheme to obtain the test environment traffic.
In an embodiment of the disclosure, the processing module 602 is further configured to:
and if the size of the testing environment flow is not equal to the target flow, adjusting the testing environment flow to adjust the size of the testing environment flow to the target flow.
The device provided in this embodiment may be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
Referring to fig. 7, a schematic structural diagram of an electronic device 700 suitable for implementing the embodiment of the present disclosure is shown, where the electronic device 700 may be a terminal device or a server. Among them, the terminal Device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a car terminal (e.g., car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, the electronic device 700 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 701, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage device 709 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; a storage device 709 including, for example, a magnetic tape, a hard disk, or the like; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 709, or installed from the storage means 709, or installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
Embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for testing an anomaly as described above is implemented.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided an anomaly testing method, including:
acquiring a service to be verified and a dependent service corresponding to the service to be verified, and acquiring an abnormal event corresponding to the service to be verified;
injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified;
and generating test result information according to the stability state corresponding to the service to be verified.
According to one or more embodiments of the present disclosure, injecting the exception event into a dependent service corresponding to the service to be verified to determine a stability state corresponding to the service to be verified includes:
after the abnormal event is injected into the dependent service corresponding to the service to be verified, stability index information corresponding to the service to be verified is obtained;
and determining the stability state corresponding to the service to be verified according to the stability index information corresponding to the service to be verified.
According to one or more embodiments of the present disclosure, if the stability indicator information corresponding to the service to be verified includes a plurality of stability indicator values, determining the stability state corresponding to the service to be verified according to the stability indicator information corresponding to the service to be verified includes:
determining whether an abnormal index value exists in the plurality of stability index values;
if the abnormal index value exists, determining that the stability state corresponding to the service to be verified is an unstable state;
and if the abnormal index value does not exist, determining that the stability state corresponding to the service to be verified is a stable state.
According to one or more embodiments of the present disclosure, determining whether there is an abnormality index value in the plurality of stability index values comprises:
generating a stability curve according to the plurality of stability index values;
if the stability curve does not have an abnormal curve segment, determining that abnormal index values do not exist in the stability index values;
and if the stability curve has an abnormal curve segment, determining that an abnormal index value exists in the stability index values.
According to one or more embodiments of the present disclosure, the abnormal curve segment is a curve segment having a slope whose absolute value is greater than a preset value.
According to one or more embodiments of the present disclosure, determining whether there is an abnormality index value in the plurality of stability index values comprises:
obtaining a difference between adjacent stability index values of the plurality of stability index values;
if the difference value between all the adjacent stability index values is within a preset difference value range, determining that no abnormal index value exists in the stability index values;
and if the difference value between the adjacent stability index values is not within the preset difference value range, determining that an abnormal index value exists in the plurality of stability index values.
According to one or more embodiments of the present disclosure, if the test result information includes a verification result corresponding to the service to be verified, the generating the test result information according to the stability status corresponding to the service to be verified includes:
if the stability state corresponding to the service to be verified is a stable state, determining that the verification result corresponding to the service to be verified is a weak dependence result;
and if the stability state corresponding to the service to be verified is an unstable state, determining that the verification result corresponding to the service to be verified is a strong dependence result.
According to one or more embodiments of the present disclosure, the method further comprises:
judging whether a verification result corresponding to the service to be verified is a standard result or not;
if the standard result is not the standard result, outputting modification prompt information;
and if the standard result is obtained, outputting a test completion prompt message.
According to one or more embodiments of the present disclosure, the test result information includes a verification result corresponding to a service to be verified and result association data, where the result association data represents data associated with generating the verification result corresponding to the service to be verified.
According to one or more embodiments of the present disclosure, the method further comprises:
acquiring test environment information and acquiring a flow construction scheme corresponding to the test environment information;
and carrying out network traffic construction operation based on the traffic construction scheme to obtain the test environment traffic.
According to one or more embodiments of the present disclosure, the method further comprises:
and if the size of the testing environment flow is not equal to the size of the target flow, adjusting the testing environment flow to adjust the size of the testing environment flow to the size of the target flow.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided an abnormality testing apparatus including:
the system comprises an information acquisition module, a verification module and a verification module, wherein the information acquisition module is used for acquiring a service to be verified and a dependent service corresponding to the service to be verified and acquiring an abnormal event corresponding to the service to be verified;
the processing module is used for injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified;
the processing module is further configured to generate test result information according to the stability state corresponding to the service to be verified.
According to one or more embodiments of the present disclosure, the processing module is further configured to:
after the abnormal event is injected into the dependent service corresponding to the service to be verified, stability index information corresponding to the service to be verified is obtained;
and determining the stability state corresponding to the service to be verified according to the stability index information corresponding to the service to be verified.
According to one or more embodiments of the present disclosure, if the stability index information corresponding to the service to be verified includes a plurality of stability index values, the processing module is further configured to:
determining whether an abnormal index value exists in the plurality of stability index values;
if the abnormal index value exists, determining that the stability state corresponding to the service to be verified is an unstable state;
and if the abnormal index value does not exist, determining that the stability state corresponding to the service to be verified is a stable state.
According to one or more embodiments of the present disclosure, the processing module is further configured to:
generating a stability curve according to the plurality of stability index values;
if the stability curve does not have an abnormal curve segment, determining that abnormal index values do not exist in the stability index values;
and if the stability curve has an abnormal curve segment, determining that an abnormal index value exists in the stability index values.
According to one or more embodiments of the present disclosure, the abnormal curve segment is a curve segment having a slope whose absolute value is greater than a preset value.
According to one or more embodiments of the present disclosure, the processing module is further configured to:
obtaining a difference between adjacent stability index values of the plurality of stability index values;
if the difference value between all the adjacent stability index values is within a preset difference value range, determining that no abnormal index value exists in the stability index values;
and if the difference value between the adjacent stability index values is not within the preset difference value range, determining that an abnormal index value exists in the plurality of stability index values.
According to one or more embodiments of the present disclosure, if the test result information includes a verification result corresponding to the service to be verified, the processing module is further configured to:
if the stability state corresponding to the service to be verified is a stable state, determining that the verification result corresponding to the service to be verified is a weak dependence result;
and if the stability state corresponding to the service to be verified is an unstable state, determining that the verification result corresponding to the service to be verified is a strong dependence result.
According to one or more embodiments of the present disclosure, the processing module is further configured to:
judging whether a verification result corresponding to the service to be verified is a standard result or not;
if the standard result is not the standard result, outputting modification prompt information;
and if the standard result is obtained, outputting a test completion prompt message.
According to one or more embodiments of the present disclosure, the test result information includes a verification result corresponding to a service to be verified and result association data, where the result association data represents data associated with generating the verification result corresponding to the service to be verified.
In one embodiment of the present disclosure, the processing module is further configured to:
acquiring test environment information and acquiring a flow construction scheme corresponding to the test environment information;
and carrying out network traffic construction operation based on the traffic construction scheme to obtain the test environment traffic.
According to one or more embodiments of the present disclosure, the processing module is further configured to:
and if the size of the testing environment flow is not equal to the size of the target flow, adjusting the testing environment flow to adjust the size of the testing environment flow to the size of the target flow.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the anomaly testing method as described above in the first aspect and in various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the anomaly testing method as described in the first aspect above and in various possible designs of the first aspect.
In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the anomaly testing method as described above in the first aspect and in various possible designs of the first aspect.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (15)

1. An anomaly testing method, comprising:
acquiring a service to be verified and a dependent service corresponding to the service to be verified, and acquiring an abnormal event corresponding to the service to be verified;
injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified;
and generating test result information according to the stability state corresponding to the service to be verified.
2. The method of claim 1, wherein injecting the exception event into a dependent service corresponding to the service to be verified to determine a stability state corresponding to the service to be verified comprises:
after the abnormal event is injected into the dependent service corresponding to the service to be verified, stability index information corresponding to the service to be verified is obtained;
and determining the stability state corresponding to the service to be verified according to the stability index information corresponding to the service to be verified.
3. The method according to claim 2, wherein if the stability indicator information corresponding to the service to be verified includes a plurality of stability indicator values, determining the stability state corresponding to the service to be verified according to the stability indicator information corresponding to the service to be verified includes:
determining whether an abnormal index value exists in the plurality of stability index values;
if the abnormal index value exists, determining that the stability state corresponding to the service to be verified is an unstable state;
and if the abnormal index value does not exist, determining that the stability state corresponding to the service to be verified is a stable state.
4. The method of claim 3, wherein determining whether an anomaly index value exists in the plurality of stability index values comprises:
generating a stability curve according to the plurality of stability index values;
if the stability curve does not have an abnormal curve segment, determining that abnormal index values do not exist in the stability index values;
and if the stability curve has an abnormal curve segment, determining that an abnormal index value exists in the stability index values.
5. The method of claim 4, wherein the abnormal curve segment is a curve segment having a slope with an absolute value greater than a predetermined value.
6. The method of claim 3, wherein determining whether an anomaly index value exists in the plurality of stability index values comprises:
obtaining a difference between adjacent stability index values of the plurality of stability index values;
if the difference value between all the adjacent stability index values is within a preset difference value range, determining that no abnormal index value exists in the stability index values;
and if the difference value between the adjacent stability index values is not within the preset difference value range, determining that an abnormal index value exists in the plurality of stability index values.
7. The method according to claim 1, wherein the test result information includes a verification result corresponding to the service to be verified, and the generating the test result information according to the stability status corresponding to the service to be verified includes:
if the stability state corresponding to the service to be verified is a stable state, determining that the verification result corresponding to the service to be verified is a weak dependence result;
and if the stability state corresponding to the service to be verified is an unstable state, determining that the verification result corresponding to the service to be verified is a strong dependence result.
8. The method of claim 7, further comprising:
judging whether a verification result corresponding to the service to be verified is a standard result or not;
if the standard result is not the standard result, outputting modification prompt information;
and if the standard result is obtained, outputting a test completion prompt message.
9. The method of claim 1, wherein the test result information comprises a verification result corresponding to a service to be verified and result association data, wherein the result association data represents data associated with generating the verification result corresponding to the service to be verified.
10. The method according to any one of claims 1 to 9, further comprising:
acquiring test environment information and acquiring a flow construction scheme corresponding to the test environment information;
and carrying out network traffic construction operation based on the traffic construction scheme to obtain the test environment traffic.
11. The method of claim 10, further comprising:
and if the size of the testing environment flow is not equal to the size of the target flow, adjusting the testing environment flow to adjust the size of the testing environment flow to the size of the target flow.
12. An anomaly testing apparatus, comprising:
the system comprises an information acquisition module, a verification module and a verification module, wherein the information acquisition module is used for acquiring a service to be verified and a dependent service corresponding to the service to be verified and acquiring an abnormal event corresponding to the service to be verified;
the processing module is used for injecting the abnormal event into a dependent service corresponding to the service to be verified so as to determine a stability state corresponding to the service to be verified;
the processing module is further configured to generate test result information according to the stability state corresponding to the service to be verified.
13. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the anomaly testing method of any one of claims 1-11.
14. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the anomaly testing method of any one of claims 1-11.
15. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the anomaly testing method of any one of claims 1 to 11.
CN202110277415.3A 2021-03-15 2021-03-15 Abnormity testing method and device and electronic device Pending CN112988494A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110277415.3A CN112988494A (en) 2021-03-15 2021-03-15 Abnormity testing method and device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110277415.3A CN112988494A (en) 2021-03-15 2021-03-15 Abnormity testing method and device and electronic device

Publications (1)

Publication Number Publication Date
CN112988494A true CN112988494A (en) 2021-06-18

Family

ID=76335594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110277415.3A Pending CN112988494A (en) 2021-03-15 2021-03-15 Abnormity testing method and device and electronic device

Country Status (1)

Country Link
CN (1) CN112988494A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113935178A (en) * 2021-10-21 2022-01-14 北京同创永益科技发展有限公司 Explosion radius control system and method for cloud-originated chaos engineering experiment
CN115081410A (en) * 2022-07-19 2022-09-20 中电金信软件有限公司 Method and device for automatically generating experiment report
CN115168222A (en) * 2022-07-21 2022-10-11 北京同创永益科技发展有限公司 Method for producing lossless chaotic engineering experiment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113935178A (en) * 2021-10-21 2022-01-14 北京同创永益科技发展有限公司 Explosion radius control system and method for cloud-originated chaos engineering experiment
CN115081410A (en) * 2022-07-19 2022-09-20 中电金信软件有限公司 Method and device for automatically generating experiment report
CN115168222A (en) * 2022-07-21 2022-10-11 北京同创永益科技发展有限公司 Method for producing lossless chaotic engineering experiment
CN115168222B (en) * 2022-07-21 2023-02-28 北京同创永益科技发展有限公司 Method for producing lossless chaotic engineering experiment

Similar Documents

Publication Publication Date Title
CN112988494A (en) Abnormity testing method and device and electronic device
CN112650685B (en) Automatic test method, device, electronic equipment and computer storage medium
CN112685290B (en) Chaotic engineering experiment method and device of system and storage medium
WO2023273561A1 (en) Test method and apparatus, electronic device, and storage medium
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112016284B (en) Electronic form processing method and device
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN111190657B (en) Activity configuration method and device, readable medium and electronic equipment
CN110554918B (en) Current limiting method, current limiting device, electronic equipment and computer readable storage medium
CN116225886A (en) Test case generation method, device, equipment, storage medium and program product
CN113760503A (en) Task migration method and device, electronic equipment and computer readable medium
CN112363885A (en) Method and device for detecting application abnormity, electronic equipment and computer readable medium
CN111984496B (en) Method, device, medium and electronic equipment for monitoring stack memory leakage
CN114116480A (en) Method, device, medium and equipment for determining application program test coverage rate
CN113656286A (en) Software testing method and device, electronic equipment and readable storage medium
CN115473839A (en) Data processing method, device and equipment based on buried point and storage medium
CN116306409B (en) Chip verification method, device, equipment and storage medium
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN116545729A (en) Multi-application security test method, device, electronic equipment and computer readable medium
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable medium
CN115203988B (en) Operation method, device, equipment and storage medium of numerical reservoir simulation example
CN116361143A (en) Software testing method, device, equipment and storage medium
CN116166519A (en) Model-based test method and equipment
CN117609029A (en) Software failure data fusion method and system based on data acquisition
CN115934461A (en) Service system monitoring method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination