CN107179986B - Pressure testing method and device of business system - Google Patents

Pressure testing method and device of business system Download PDF

Info

Publication number
CN107179986B
CN107179986B CN201610136597.1A CN201610136597A CN107179986B CN 107179986 B CN107179986 B CN 107179986B CN 201610136597 A CN201610136597 A CN 201610136597A CN 107179986 B CN107179986 B CN 107179986B
Authority
CN
China
Prior art keywords
test
information
login
login session
service system
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.)
Active
Application number
CN201610136597.1A
Other languages
Chinese (zh)
Other versions
CN107179986A (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610136597.1A priority Critical patent/CN107179986B/en
Publication of CN107179986A publication Critical patent/CN107179986A/en
Application granted granted Critical
Publication of CN107179986B publication Critical patent/CN107179986B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a pressure testing method and device of a service system. The method comprises the following steps: acquiring test account configuration file information, wherein the test account configuration file information comprises account information of a plurality of test accounts; generating a plurality of login request information according to the test account configuration file information so as to log in a service system to generate a plurality of login session information; storing the account information of the plurality of test accounts and the plurality of login session information into a memory mapping table; when a pressure test is carried out on a service system, a plurality of service pressure test requests are generated according to the account information of a plurality of test accounts; and generating a plurality of service pressure test request data according to the plurality of service pressure test requests and the memory mapping table, and sending the plurality of service pressure test request data to the service system to perform pressure test on the service system. The method ensures the centralization of the pressure test of the service system by independently executing the login parts of a plurality of test accounts.

Description

Pressure testing method and device of business system
Technical Field
The present application relates to the field of software testing technologies, and in particular, to a method and an apparatus for testing a pressure of a service system.
Background
Generally, to ensure the performance and availability of a business system, the business system may be stressed to test the maximum load situation that the system can withstand. For example, relevant applications such as shopping and ticket purchasing are prone to peak requests during spring festival, twenty-one season, and the like, and in order to ensure that the service systems corresponding to these applications still operate well, stress testing needs to be performed on the service systems, for example, to test the maximum user access amount that the systems can bear.
In the related art, when a stress test of a business system is performed, a large number of test accounts need to be prepared, so that a peak request scene of a large number of users to the system is simulated according to the test accounts. When the pressure test of the service system is carried out, the server needs to check the login state of the account number first, so before the service request is executed, a large number of users need to be simulated to carry out login operation according to the test account number, after the server returns the sessionID of the test account number, the service request is generated and provided with the sessionID to pass the login state check, and the service request is executed when the login state check is passed so as to realize the pressure test of the service system.
However, the pressure test mode of the service system can be understood as serial operation of firstly logging in and then requesting the service, and in the test process, because the service pressure test request is mixed with an account login request, the problems of resource waste of a pressure test platform, overlarge pressure of a logging system, unstable flow of the service pressure test request and the like can be caused; in addition, since the Session is not reusable, after the pressure test service is replaced or the pressure test needs to be suspended, since the Session timeliness is short, the test account needs to be logged again during the pressure test again, so that the login state is frequently checked.
Disclosure of Invention
The object of the present application is to solve at least to some extent one of the above mentioned technical problems.
Therefore, a first objective of the present application is to provide a method for pressure testing of a service system, which implements a login portion for executing a plurality of test accounts independently, avoids the influence of the login portion on the pressure testing of the service system, and ensures the centralization of the pressure testing of the service system, so that the service pressure testing can be guaranteed to be pure and not influenced by login, and the flow control is transparent.
A second object of the present application is to provide a pressure testing apparatus for a service system.
To achieve the above object, an embodiment according to a first aspect of the present application provides a method for stress testing of a service system, including the following steps: acquiring test account configuration file information, wherein the test account configuration file information comprises account information of a plurality of test accounts; generating a plurality of login request information according to the test account configuration file information, and logging in the service system according to the login request information to generate a plurality of login session information; storing the account information of the test accounts and the login session information into a memory mapping table; when the business system is subjected to stress testing, generating a plurality of business stress testing requests according to the account information of the testing accounts; and generating a plurality of service pressure test request data according to the plurality of service pressure test requests and the memory mapping table, and sending the plurality of service pressure test request data to the service system to perform pressure test on the service system.
According to the pressure testing method of the service system, a plurality of login request information are generated according to account configuration file information containing account information of a plurality of testing accounts, login is conducted on the service system according to the login request information to generate a plurality of login session information, and then the account information of the testing accounts and the login session information are stored in a memory mapping table. When the pressure test is carried out on the service system, a plurality of service pressure test requests are generated according to the account information of a plurality of test accounts, a plurality of service pressure test request data can be generated according to the plurality of service pressure test requests and the memory mapping table, and finally the pressure test request data is sent to the service system so as to carry out the pressure test on the service system. Through the implementation mode, the login part for independently executing a plurality of test accounts is realized, namely, the large-batch test accounts are logged in advance and preheated, and the acquired session is stored, so that the session is directly acquired from the session pool to check the login state when the business pressure test is executed, the influence of the login part on the business system pressure test is avoided, the centralization of the business system pressure test is ensured, the business pressure test can be ensured to be pure, the login influence is avoided, and the flow control is transparent.
To achieve the above object, according to an embodiment of the second aspect of the present application, there is provided a pressure testing apparatus for a business system, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring test account configuration file information, and the test account configuration file information comprises account information of a plurality of test accounts; the first generation module is used for generating a plurality of login request information according to the test account configuration file information and logging in the service system according to the login request information to generate a plurality of login session information; the storage module is used for storing the account information of the test accounts and the login session information into a memory mapping table; the second generation module is used for generating a plurality of service stress test requests according to the account information of the plurality of test accounts when the service system is subjected to stress test; a third generating module, configured to generate multiple service pressure test request data according to the multiple service pressure test requests and the memory mapping table; and the sending module is used for sending the plurality of service pressure test request data to the service system so as to carry out pressure test on the service system.
The pressure testing device of the service system in the embodiment of the application generates a plurality of login request information according to account configuration file information including account information of a plurality of testing accounts, logs in the service system according to the login request information to generate a plurality of login session information, further stores the account information of the testing accounts and the login session information into a memory mapping table, generates a plurality of service pressure testing requests according to the account information of the testing accounts when the service system is subjected to pressure testing, generates a plurality of service pressure testing request data according to the service pressure testing requests and the memory mapping table, and finally sends the pressure testing request data to the service system to perform pressure testing on the service system. Through the implementation mode, the login part for independently executing a plurality of test accounts is realized, namely, the large-batch test accounts are logged in advance and preheated, and the acquired session is stored, so that the session is directly acquired from the session pool to check the login state when the business pressure test is executed, the influence of the login part on the business system pressure test is avoided, the centralization of the business system pressure test is ensured, the business pressure test can be ensured to be pure, the login influence is avoided, and the flow control is transparent.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of a method of stress testing of a business system according to one embodiment of the present application;
FIG. 2 is a flow chart of a method of stress testing of a business system according to another embodiment of the present application;
FIG. 3 is a schematic structural diagram of a pressure testing device of a business system according to one embodiment of the present application;
FIG. 4 is a schematic structural diagram of a pressure testing device of a business system according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a pressure testing device of a business system according to another embodiment of the present application;
FIG. 6 is a schematic structural diagram of a pressure testing device of a business system according to another embodiment of the present application; and
fig. 7 is a schematic structural diagram of a pressure testing apparatus of a business system according to still another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
Fig. 1 is a flowchart of a pressure testing method of a business system according to an embodiment of the present application. It should be noted that the pressure testing method for the service system according to the embodiment of the present application may be applied to a pressure testing platform, where the pressure testing platform performs a pressure test on the service system through the pressure testing method for the service system according to the present application, so as to test a maximum load condition of the system, so that relevant personnel (such as testers and developers) can debug the service system according to a test result. In addition, the services in the embodiment of the present application may be understood as various functions in an application or a system, for example, taking a wechat application as an example, the services included in the wechat application include, for example, sending a message, adding a friend, shaking one, red envelope, brushing a friend circle, and the like.
As shown in fig. 1, the method for testing the pressure of the service system includes:
s110, obtaining test account configuration file information, wherein the test account configuration file information comprises account information of a plurality of test accounts.
It can be understood that before the pressure test is performed on the service system, a test script may be prepared in advance for the pressure test on the service system, where the test script at least includes, but is not limited to, test account configuration file information and service information to be tested, and the service information to be tested includes, for example, a type of a service, a test code corresponding to implementing the service function, and the like.
In order to complete login preheating operation of a plurality of test accounts before a pressure test is performed on a service system, a large number of test accounts need to be prepared in advance, and account information of the large number of test accounts can be gathered to a test account configuration file so that a large number of users can be simulated to perform login operation according to the test accounts in a subsequent pressure test process.
In an embodiment of the present application, at the beginning stage of the stress test, a pre-prepared test script may be loaded, and during the process of executing the test script, profile information of a test account may be obtained according to the test script, where the profile information of the test account includes account information of a plurality of test accounts, such as user IDs (identities), user nicknames, and/or passwords of the test accounts.
And S120, generating a plurality of login request information according to the test account configuration file information, and logging in a service system according to the login request information to generate a plurality of login session information.
Specifically, login request information corresponding to each test account included in the configuration file may be generated according to the test account configuration file, where the login request information includes, for example, a user ID, a password, and the like of the account, and then, the login request information may be sent to the service system. When the service system receives the login request information, the service system can complete the login operation of the corresponding test account according to the login request information, generate login Session information Session, and feed back the login Session information Session to the pressure test platform.
S130, storing the account information of the plurality of test accounts and the plurality of login session information into a memory mapping table.
It can be understood that, in order to implement unified management on the login part in the stress test of the service system, after the stress test platform receives the registrable Session information Session fed back by the service system, the account information of each test account and the corresponding login Session information Session may be stored in the memory mapping table. That is, the memory mapping table may store a plurality of test accounts and corresponding login session information.
Specifically, in an embodiment of the present application, a specific implementation process of saving the account information of the plurality of test accounts and the plurality of login session information in the memory mapping table may include the following steps: and determining the corresponding relation between the account information of each test account and each login information, and storing the account information of the plurality of test accounts and the plurality of login session information into a memory mapping table according to the corresponding relation and a preset format, wherein each test account, the login session information and the corresponding relation between the test account and the login session information can be clearly stored according to the preset format.
It is to be understood that, in order to distinguish each login session information, each login session information may be assigned an ID, for example, the login session information is represented by a SessionID. For example, after a login request of a plurality of test accounts is executed to the service system, login session information SessionID corresponding to each test account is obtained, and at this time, each login session information SessionID may be cached and stored in the memory mapping table in a format of < user ID, SessionID >.
S140, when the business system is subjected to stress test, a plurality of business stress test requests are generated according to the account information of a plurality of test accounts.
It can be understood that when the business system is subjected to stress testing, a plurality of business stress testing requests can be generated according to the account information of a plurality of accounts through a testing script prepared in advance, so as to simulate a scene that a plurality of users carry out business requests on the business system.
S150, generating a plurality of service pressure test request data according to the plurality of service pressure test requests and the memory mapping table, and sending the plurality of service pressure test request data to the service system to perform pressure test on the service system.
It can be understood that, at this time, all the test accounts may be considered to be already in the login state, and the test accounts are logged in the service system for the purpose of implementing the test accounts and ensuring that the login state of the test accounts is verified to be passed. Specifically, in the embodiment of the present application, a plurality of login session information corresponding to the account information of the plurality of test accounts may be searched from the memory mapping table according to the account information of the plurality of test accounts, and the login session information corresponding to the account information of the plurality of test accounts is added to cookies of the service pressure test requests corresponding to the login session information of the plurality of test accounts, so as to generate a plurality of pieces of service pressure test request data. And then, sending the data of each service pressure test request to a service system, wherein the service system can complete the verification of the login state of the corresponding test account according to the login session information sessionID in the data of each service pressure test request, and carry out pressure test on the service system according to each service pressure test request.
That is to say, when the service system is subjected to the pressure test, all the test accounts are already in the login state, when the service pressure test request data is constructed, only the corresponding SessionID needs to be found from the memory mapping table according to the user ID of the test account, the SessionID is carried in the uplink request, for example, the SessionID is put into the Cookie in the HTTP request, so that the corresponding service in the service system is subjected to the pressure test according to the service pressure test request in the service pressure test request data while the verification of the login state is passed. Therefore, a login operation is not required to be performed every time when the business system is subjected to the pressure test, and only the corresponding Session ID is required to be found from a memory mapping table (such as a Session pool) and added into the Cookie of the business pressure test request to verify the login state, so that the login operation process is omitted, the pureness of the business pressure test request can be achieved, and the flow control can be more transparent.
In the embodiment of the present application, the service stress test request data is short link request data. Therefore, in order to ensure that the session is effective for a long time and the validity of the link is ensured, a heartbeat request can be sent to the service system at regular time so as to prolong the failure time for the login session information in the memory mapping table at regular time. Further, in an embodiment of the present application, after logging in to the service system according to the multiple login request information to generate multiple login session information, the stress testing method may further include: and periodically generating a plurality of heartbeat requests according to the account information of the plurality of test accounts, and sending the heartbeat requests to the service system so as to carry out failure time prolonging operation on the login session information in the memory mapping table. In the embodiment of the present application, the time interval of the period may be smaller than the expiration time of the login session information (i.e., session). Therefore, the heartbeat request is sent at regular time so as to prolong the failure time for each login session information session in the memory mapping table at regular time.
The method for testing the pressure of the service system includes the steps of generating a plurality of login request information according to account configuration file information including account information of a plurality of test accounts, logging in the service system according to the login request information to generate a plurality of login session information, storing the account information of the test accounts and the login session information into a memory mapping table, generating a plurality of service pressure test requests according to the account information of the test accounts when the service system is subjected to pressure testing, generating a plurality of service pressure test request data according to the service pressure test requests and the memory mapping table, and finally sending the pressure test request data to the service system to perform pressure testing on the service system. Through the implementation mode, the login part for independently executing a plurality of test accounts is realized, namely, the large-batch test accounts are logged in advance and preheated, and the acquired session is stored, so that the session is directly acquired from the session pool to check the login state when the business pressure test is executed, the influence of the login part on the business system pressure test is avoided, the centralization of the business system pressure test is ensured, the business pressure test can be ensured to be pure, the login influence is avoided, and the flow control is transparent.
Fig. 2 is a flowchart of a pressure testing method of a service system according to another embodiment of the present application.
In order to improve the practicability of the pressure test and to omit repeated login operation during the pressure test as much as possible, in the embodiment of the present application, the login session information session may be persisted, that is, after the login session information is generated, the account information of each test account and each login session information may be written into a preset file to generate a login session file, so that the pressure test plan for the business system may be dynamically adjusted according to the login session file.
Specifically, as shown in fig. 2, the method for testing the pressure of the service system includes:
s210, obtaining test account configuration file information, wherein the test account configuration file information comprises account information of a plurality of test accounts.
And S220, generating a plurality of login request information according to the test account configuration file information, and logging in a service system according to the login request information to generate a plurality of login session information.
And S230, writing the account information of the plurality of test accounts and the plurality of login session information into a preset file to generate a login session file.
In order to facilitate dynamic adjustment of a pressure test plan for a business system, repeated login operation during pressure test is omitted as much as possible, and login session information session can be persisted, that is, account information of a plurality of test accounts and a plurality of login session information are written into a preset file to generate a login session file. It will be appreciated that the account information and corresponding login session information are written to a designated file, for example, in a < user ID, sessionID > format to form a login session file.
In an embodiment of the present application, on the premise that the account information of each test account and each login session information are written into a preset file to generate a login session file, after detecting that the stress test on the service system is suspended, the stress test method may further include: detecting whether a recovery instruction input aiming at the pressure test of the service system is received or not, and if the recovery instruction input aiming at the pressure test of the service system is received, judging whether the information of the plurality of login sessions in the memory mapping table is invalid or not; if the login session information in the memory mapping table is not invalid, loading the login session file to reload the login session information in the login session file into the memory mapping table; and if the login session information in the memory mapping table fails, generating a plurality of login request information again according to the test account configuration file information, and logging in the service system according to the login request information to generate a plurality of login session information.
Specifically, in the process of performing a pressure test on the business system, if it is detected that the pressure test on the business system in the midway is suspended, for example, a midway tester wants to replace a business object to be tested, or replace a test script, or suspend the pressure test on the business system due to other reasons, when it is detected that a recovery instruction for the pressure test on the business system is received, and in the case that the session login ID of the login session information is not invalid, the login session file generated by the previous login preheating can be directly loaded, and each login session information in the login session file is reloaded into the memory mapping table in the format of < user ID, sessionID >. Therefore, the login request can be prevented from being generated again to carry out login operation again to the service system to generate login session information, and waste of resources is avoided.
S240, storing the account information of the plurality of test accounts and the plurality of login session information into a memory mapping table.
It should be noted that, in the embodiment of the present application, the execution of the step S230 and the step S240 may not be in a sequential order, for example, the step S230 may be executed first and then the step S240 is executed, the step S240 may be executed first and then the step S230 is executed, or the step S230 and the step S240 may be executed simultaneously.
And S250, when the pressure test is carried out on the service system, generating a plurality of service pressure test requests according to the account information of the plurality of test accounts.
And S260, generating a plurality of service pressure test request data according to the plurality of service pressure test requests and the memory mapping table, and sending the plurality of service pressure test request data to the service system to perform pressure test on the service system.
According to the pressure test request method for the service system, after login session information is generated, the account information of a plurality of test accounts and the login session information are written into a preset file to generate a login session file, so that after the pressure test on the service system is suspended, when a recovery instruction input by the pressure test aiming at the service system is detected and the login session information is not invalid, the login session information in the login session file can be directly loaded into a memory mapping table, the waste of resources is avoided, the practicability of the pressure test method is improved, meanwhile, the pressure test plan of the service system is conveniently and dynamically adjusted, and repeated login operation during the pressure test is omitted as much as possible.
In order to implement the above embodiments, the present application further provides a pressure testing apparatus for a service system. Fig. 3 is a schematic structural diagram of a pressure testing apparatus of a service system according to an embodiment of the present application. As shown in fig. 3, the pressure testing apparatus of the service system includes: an acquisition module 310, a first generation module 320, a saving module 330, a second generation module 340, a third generation module 350, and a sending module 360.
The obtaining module 310 is configured to obtain test account configuration file information, where the test account configuration file information includes account information of multiple test accounts.
It can be understood that before the pressure test is performed on the service system, a test script may be prepared in advance for the pressure test on the service system, where the test script at least includes, but is not limited to, test account configuration file information and service information to be tested, and the service information to be tested includes, for example, a type of a service, a test code corresponding to implementing the service function, and the like.
In order to complete login preheating operation of a plurality of test accounts before a pressure test is performed on a service system, a large number of test accounts need to be prepared in advance, and account information of the large number of test accounts can be gathered to a test account configuration file so that a large number of users can be simulated to perform login operation according to the test accounts in a subsequent pressure test process.
In an embodiment of the present application, at the beginning stage of the stress test, the obtaining module 310 may load a pre-prepared test script, and in the process of executing the test script, may obtain profile information of a test account according to the test script, where the profile information of the test account includes account information of a plurality of test accounts, such as a user ID, a user nickname, and/or a password of the test account.
The first generating module 320 is configured to generate a plurality of login request information according to the test account configuration file information, and log in to the service system according to the plurality of login request information to generate a plurality of login session information.
Specifically, the first generating module 320 may generate login request information corresponding to each test account included in the configuration file according to the test account configuration file, where the login request information includes, for example, a user ID, a password, and the like of the account, and then may send the login request information to the service system. When the service system receives the login request information, the service system can complete the login operation of the corresponding test account according to the login request information, generate login Session information Session, and feed back the login Session information Session to the pressure test platform.
The saving module 330 is configured to save the account information of the multiple test accounts and the multiple login session information in a memory mapping table.
It can be understood that, in order to implement unified management on the login portion in the stress test of the service system, after the stress test platform receives the registrable Session information Session fed back by the service system, the storage module 330 may be used to store the account information of each test account and the corresponding login Session information Session into the memory mapping table. That is, the memory mapping table may store a plurality of test accounts and corresponding login session information.
Specifically, fig. 4 is a schematic structural diagram of a pressure testing apparatus of a business system according to an embodiment of the present application. As shown in fig. 4, the storage module 330 in the pressure testing apparatus of the service system specifically includes: a determination unit 331 and a saving unit 332. In an embodiment of the application, the determining unit 331 determines a correspondence between the account information of each test account and each login information, and the storing unit 332 stores the account information of the plurality of test accounts and the plurality of login session information into a memory mapping table according to the correspondence and a preset format, where each test account and the login session information and the correspondence between the test account and the login session information can be clearly stored according to the preset format.
The second generating module 340 is configured to generate a plurality of service stress test requests according to the account information of the plurality of test accounts when the service system is subjected to stress test.
It can be understood that, when the business system is subjected to the stress test, the second generating module 340 may generate a plurality of business stress test requests according to the account information of the plurality of accounts through a pre-prepared test script, so as to simulate a scenario in which a plurality of users perform business requests on the business system.
The third generating module 350 is configured to generate a plurality of traffic pressure test request data according to the plurality of traffic pressure test requests and the memory mapping table.
It can be understood that, at this time, all the test accounts may be considered to be already in the login state, and the test accounts are logged in the service system for the purpose of implementing the test accounts and ensuring that the login state of the test accounts is verified to be passed.
Fig. 5 is a schematic structural diagram of a pressure testing device of a business system according to another embodiment of the present application. As shown in fig. 5, the third generating module 350 in the pressure testing apparatus of the service system specifically includes: a lookup unit 351 and a generation unit 352.
Specifically, in the embodiment of the present application, the searching unit 351 may search, according to the account information of the multiple test accounts, multiple pieces of login session information corresponding to the account information of the multiple test accounts from the memory mapping table, and the generating unit 352 adds the multiple pieces of login session information corresponding to the account information of the multiple test accounts to cookies of the service pressure test requests corresponding to the multiple pieces of login session information to generate multiple pieces of service pressure test request data.
That is to say, when the service system is subjected to the pressure test, all the test accounts are already in the login state, when the service pressure test request data is constructed, only the corresponding SessionID needs to be found from the memory mapping table according to the user ID of the test account, the SessionID is carried in the uplink request, for example, the SessionID is put into the Cookie in the HTTP request, so that the corresponding service in the service system is subjected to the pressure test according to the service pressure test request in the service pressure test request data while the verification of the login state is passed. Therefore, a login operation is not required to be performed every time when the business system is subjected to the pressure test, and only the corresponding Session ID is required to be found from a memory mapping table (such as a Session pool) and added into the Cookie of the business pressure test request to verify the login state, so that the login operation process is omitted, the pureness of the business pressure test request can be achieved, and the flow control can be more transparent.
The sending module 360 is configured to send the multiple service stress test request data to the service system to perform a stress test on the service system.
In the embodiment of the present application, the sending module 360 sends each service pressure test request data to the service system, and the service system can complete the verification of the login state of the corresponding test account according to the login session information SessionID in each service pressure test request data, and perform a pressure test on the service system according to each service pressure test request.
In the embodiment of the present application, the service stress test request data is short link request data. Therefore, in order to ensure that the session is effective for a long time and the validity of the link is ensured, a heartbeat request can be sent to the service system at regular time so as to prolong the failure time for the login session information in the memory mapping table at regular time.
Fig. 6 is a schematic structural diagram of a pressure testing apparatus of a business system according to another embodiment of the present application. As shown in fig. 6, on the basis of fig. 3, the pressure testing apparatus of the service system further includes: a fourth generation module 370 and a dead time extension module 380.
Specifically, the fourth generation module 370 is configured to periodically generate a plurality of heartbeat requests according to the account information of the plurality of test accounts after the first generation module 320 logs in to the service system according to the plurality of login request information to generate the plurality of login session information, and the failure extension module 380 is configured to send the plurality of heartbeat requests to the service system to perform the failure time extension operation on the plurality of login session information in the memory mapping table. In the embodiment of the present application, the time interval of the period may be smaller than the expiration time of the login session information (i.e., session). Thus, the expiration time extension module 380 periodically extends the expiration time for each session of login session information in the memory mapping table by periodically transmitting the heartbeat request generated by the fourth generation module 370.
The pressure testing device of the service system in the embodiment of the application generates a plurality of login request information according to account configuration file information including account information of a plurality of testing accounts, logs in the service system according to the login request information to generate a plurality of login session information, further stores the account information of the testing accounts and the login session information into a memory mapping table, generates a plurality of service pressure testing requests according to the account information of the testing accounts when the service system is subjected to pressure testing, generates a plurality of service pressure testing request data according to the service pressure testing requests and the memory mapping table, and finally sends the pressure testing request data to the service system to perform pressure testing on the service system. Through the implementation mode, the login part for independently executing a plurality of test accounts is realized, namely, the large-batch test accounts are logged in advance and preheated, and the acquired session is stored, so that the session is directly acquired from the session pool to check the login state when the business pressure test is executed, the influence of the login part on the business system pressure test is avoided, the centralization of the business system pressure test is ensured, the business pressure test can be ensured to be pure, the login influence is avoided, and the flow control is transparent.
In order to improve the practicability of the pressure test and to omit repeated login operation during the pressure test as much as possible, in the embodiment of the present application, the login session information session may be persisted, that is, after the login session information is generated, the account information of each test account and each login session information may be written into a preset file to generate a login session file, so that the pressure test plan for the business system may be dynamically adjusted according to the login session file.
Fig. 7 is a schematic structural diagram of a pressure testing apparatus of a business system according to still another embodiment of the present application. As shown in fig. 7, on the basis of fig. 3, the pressure testing apparatus of the service system further includes: a fifth generation module 390, a detection module 3100, a determination module 3110, and a loading module 3120.
The fifth generating module 390 is configured to, after the first generating module 320 logs in the service system according to the login request information to generate a plurality of login session information, write the account information of the test accounts and the login session information into a preset file to generate a login session file.
In order to facilitate dynamic adjustment of the stress test plan for the business system, to omit repeated login operation during stress test as much as possible, the login session information session may be persisted, that is, the fifth generating module 390 may write the account information of the multiple test accounts and the multiple login session information into a preset file to generate a login session file. It will be appreciated that the account information and corresponding login session information are written to a designated file, for example, in a < user ID, sessionID > format to form a login session file.
In an embodiment of the present application, on the premise that the fifth generating module 390 writes the account information and login session information of each test account into a preset file to generate a login session file, after detecting that the pressure test on the service system is suspended, the detecting module 3100 detects whether a recovery instruction input for the pressure test on the service system is received, and the determining module 3110 determines whether a plurality of login session information in the memory mapping table are invalid when receiving the recovery instruction input for the pressure test on the service system; if the determining module 3110 determines that the multiple login session information in the memory mapping table is not invalid, the loading module 3120 loads the login session file to reload the multiple login session information in the login session file into the memory mapping table; if the determining module 3110 determines that the multiple login session information in the memory mapping table is invalid, the first generating module 320 is further configured to generate multiple login request information according to the test account configuration file information again, and log in the service system according to the multiple login request information to generate multiple login session information.
Specifically, in the process of performing a pressure test on the business system, if the detection module 3100 detects that the pressure test on the business system is suspended halfway, for example, a halfway tester wants to replace a business object to be tested, or replace a test script, or the tester suspends the pressure test on the business system due to other reasons, when the detection module 3100 detects that a recovery instruction for the pressure test on the business system is received, and when the determination module 3110 determines that the session login session information sessionID does not fail, the login session file generated by the previous login preheating may be directly loaded by the loading module 3120, and each login session information in the login session file is reloaded into the memory mapping table in the format of < user ID, sessionID >. Therefore, the first generation module 320 can be prevented from generating the login request again to perform the login operation again to the service system to generate the login session information, and the waste of resources is avoided.
According to the pressure test request device of the business system, after the login session information is generated, the account information of the test accounts and the login session information are written into the preset file to generate the login session file, so that after the pressure test on the business system is suspended, when a recovery instruction input by the pressure test aiming at the business system is detected and the login session information is not invalid, the login session information in the login session file can be directly loaded into the memory mapping table, the waste of resources is avoided, the practicability of the pressure test device is improved, meanwhile, the pressure test plan on the business system can be conveniently and dynamically adjusted, and repeated login operation during the pressure test is omitted as far as possible.
In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. A pressure test method of a service system is characterized by comprising the following steps:
acquiring test account configuration file information, wherein the test account configuration file information comprises account information of a plurality of test accounts;
generating a plurality of login request information according to the test account configuration file information, and logging in the service system according to the login request information to generate a plurality of login session information;
storing the account information of the test accounts and the login session information into a memory mapping table;
when the business system is subjected to stress testing, generating a plurality of business stress testing requests according to the account information of the testing accounts; and
generating a plurality of service pressure test request data according to the plurality of service pressure test requests and the memory mapping table, and sending the plurality of service pressure test request data to the service system to perform pressure test on the service system;
generating a plurality of service pressure test request data according to the plurality of service pressure test requests and the memory mapping table includes:
searching a plurality of login session information corresponding to the account information of the plurality of test accounts from the memory mapping table according to the account information of the plurality of test accounts;
and adding the login session information corresponding to the account information of the test accounts into the Cookie of the service stress test request corresponding to each login session information to generate the data of the service stress test requests.
2. The method for stress testing of a business system of claim 1, wherein the step of storing the account information of the test accounts and the login session information into a memory mapping table comprises:
determining the corresponding relation between the account information of each test account and the login session information;
and storing the account information and the login session information of the test accounts into the memory mapping table according to the corresponding relationship and a preset format.
3. The method for stress testing of business system according to claim 1, further comprising, after said logging in to said business system to generate a plurality of login session information according to said plurality of login request information:
and periodically generating a plurality of heartbeat requests according to the account information of the plurality of test accounts, and sending the plurality of heartbeat requests to the service system so as to carry out failure time prolonging operation on the plurality of login session information in the memory mapping table.
4. The method for stress testing of business system according to claim 1, further comprising, after said logging in to said business system to generate a plurality of login session information according to said plurality of login request information:
and writing the account information of the plurality of test accounts and the plurality of login session information into a preset file to generate a login session file.
5. The pressure test method of the service system according to claim 4, further comprising, after detecting that the pressure test of the service system is suspended:
detecting whether a recovery instruction input aiming at the pressure test of the service system is received;
if a recovery instruction input aiming at the pressure test of the service system is received, judging whether the login session information in the memory mapping table is invalid or not;
if the plurality of login session information in the memory mapping table is not invalid, loading the login session file to reload the plurality of login session information in the login session file into the memory mapping table;
and if the login session information in the memory mapping table fails, generating a plurality of login request information again according to the test account configuration file information, and logging in the service system according to the login request information to generate a plurality of login session information.
6. A pressure testing apparatus for a business system, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring test account configuration file information, and the test account configuration file information comprises account information of a plurality of test accounts;
the first generation module is used for generating a plurality of login request information according to the test account configuration file information and logging in the service system according to the login request information to generate a plurality of login session information;
the storage module is used for storing the account information of the test accounts and the login session information into a memory mapping table;
the second generation module is used for generating a plurality of service stress test requests according to the account information of the plurality of test accounts when the service system is subjected to stress test;
a third generating module, configured to generate multiple service pressure test request data according to the multiple service pressure test requests and the memory mapping table; wherein the third generating module comprises:
the searching unit is used for searching a plurality of login session information corresponding to the account information of the plurality of test accounts from the memory mapping table according to the account information of the plurality of test accounts;
a generating unit, configured to add the login session information corresponding to the account information of the plurality of test accounts to cookies of the service stress test requests corresponding to the login session information to generate the plurality of service stress test request data; and
and the sending module is used for sending the plurality of service pressure test request data to the service system so as to carry out pressure test on the service system.
7. The pressure testing apparatus of business system of claim 6, wherein said saving module comprises:
the determining unit is used for determining the corresponding relation between the account information of each test account and the login session information;
and the storage unit is used for storing the account information and the login session information of the plurality of test accounts into the memory mapping table according to the corresponding relationship and a preset format.
8. The pressure test apparatus of a service system according to claim 6, further comprising:
a fourth generating module, configured to periodically generate a plurality of heartbeat requests according to the account information of the plurality of test accounts after the first generating module logs in the service system according to the plurality of login request information to generate a plurality of login session information;
and the failure time prolonging module is used for sending the heartbeat requests to the service system so as to prolong the failure time of the login session information in the memory mapping table.
9. The pressure test apparatus of a service system according to claim 6, further comprising:
and the fifth generating module is used for writing the account information of the plurality of test accounts and the plurality of login session information into a preset file to generate a login session file after the first generating module logs in the service system according to the plurality of login request information to generate a plurality of login session information.
10. The pressure test apparatus of a service system according to claim 9, further comprising:
the detection module is used for detecting whether a recovery instruction input aiming at the pressure test of the service system is received or not after the pressure test of the service system is detected to be suspended;
the judging module is used for judging whether the login session information in the memory mapping table is invalid or not when a recovery instruction input aiming at the pressure test of the service system is received;
a loading module, configured to load the login session file to reload the login session information in the login session file into the memory mapping table when the determining module determines that the login session information in the memory mapping table is not invalid;
the first generating module is further configured to, when the determining module determines that the login session information in the memory mapping table is invalid, generate a plurality of login request information according to the test account configuration file information again, and log in the service system according to the login request information to generate a plurality of login session information.
CN201610136597.1A 2016-03-10 2016-03-10 Pressure testing method and device of business system Active CN107179986B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610136597.1A CN107179986B (en) 2016-03-10 2016-03-10 Pressure testing method and device of business system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610136597.1A CN107179986B (en) 2016-03-10 2016-03-10 Pressure testing method and device of business system

Publications (2)

Publication Number Publication Date
CN107179986A CN107179986A (en) 2017-09-19
CN107179986B true CN107179986B (en) 2020-09-08

Family

ID=59830617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610136597.1A Active CN107179986B (en) 2016-03-10 2016-03-10 Pressure testing method and device of business system

Country Status (1)

Country Link
CN (1) CN107179986B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483295B (en) * 2017-09-22 2020-12-01 武汉虹信科技发展有限责任公司 Method for testing processing capacity of network management system
CN110035091B (en) * 2018-01-11 2021-10-22 杭州海康威视数字技术股份有限公司 Method, device and server for modifying session information in network information system
CN110196802B (en) * 2018-02-26 2024-01-12 财付通支付科技有限公司 Test data processing method, device and server
CN109348499B (en) * 2018-11-30 2022-02-25 奇安信科技集团股份有限公司 Pressure testing system and method
CN110928771A (en) * 2019-10-30 2020-03-27 苏州浪潮智能科技有限公司 Method and system for timed automatic batch test of Rest interfaces
CN111209207B (en) * 2020-01-13 2023-07-18 中国铁道科学研究院集团有限公司电子计算技术研究所 Performance test method, device and system of passenger ticket system
CN112433933A (en) * 2020-04-09 2021-03-02 上海哔哩哔哩科技有限公司 Method and equipment for automatically testing interface
CN111881057B (en) * 2020-08-06 2023-08-15 中国工商银行股份有限公司 Test method, test device, test system and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882105A (en) * 2010-06-01 2010-11-10 华南理工大学 Method for testing response time of Web page under concurrent environment
CN102479146A (en) * 2010-11-30 2012-05-30 金蝶软件(中国)有限公司 Scenario testing monitoring method, device and system
CN102957728A (en) * 2011-08-26 2013-03-06 华为终端有限公司 Management session establishment method, customer-premises equipment and automatic configuration server
CN103475630A (en) * 2012-06-08 2013-12-25 深圳中兴网信科技有限公司 Session preservation method and apparatus thereof
CN103634159A (en) * 2012-08-24 2014-03-12 百度在线网络技术(北京)有限公司 Registration simulation-based flow playback method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10044820B2 (en) * 2013-09-23 2018-08-07 Infosys Limited Method and system for automated transaction analysis

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882105A (en) * 2010-06-01 2010-11-10 华南理工大学 Method for testing response time of Web page under concurrent environment
CN102479146A (en) * 2010-11-30 2012-05-30 金蝶软件(中国)有限公司 Scenario testing monitoring method, device and system
CN102957728A (en) * 2011-08-26 2013-03-06 华为终端有限公司 Management session establishment method, customer-premises equipment and automatic configuration server
CN103475630A (en) * 2012-06-08 2013-12-25 深圳中兴网信科技有限公司 Session preservation method and apparatus thereof
CN103634159A (en) * 2012-08-24 2014-03-12 百度在线网络技术(北京)有限公司 Registration simulation-based flow playback method and apparatus

Also Published As

Publication number Publication date
CN107179986A (en) 2017-09-19

Similar Documents

Publication Publication Date Title
CN107179986B (en) Pressure testing method and device of business system
US10606738B2 (en) Application testing on a blockchain
CN110427324B (en) Joint debugging system, joint debugging method, computer equipment and storage medium
US8943209B2 (en) Methods, systems, and computer readable media for policy and charging rules function (PCRF) fault tolerance
CN105808399B (en) Remote debugging method and device
CN109617759A (en) Block catenary system stability test method, apparatus, equipment and storage medium
CN106489251A (en) The methods, devices and systems that applied topology relation finds
EP3867747B1 (en) Dynamic monitoring and control of web page experiences based upon user activity of associated applications
CN109213571B (en) Memory sharing method, container management platform and computer readable storage medium
US9355005B2 (en) Detection apparatus and detection method
CN108459850B (en) Method, device and system for generating test script
US9934000B2 (en) Balancing consumption of random data
CN111245910B (en) Block chain light node multi-copy deployment method
US12001315B2 (en) Provisioning and debugging system in a cloud environment
US20080028034A1 (en) Method for mapping an iscsi target name to a storage resource based on an initiator hardware class identifier
CN112699034B (en) Virtual login user construction method, device, equipment and storage medium
CN107506295A (en) Method of testing, equipment and the computer-readable recording medium of virtual machine backup
CN116204438A (en) Test case generation method, automatic test method and related device
CN115328752A (en) Cluster simulation method and system for Kubernetes control plane test
CN113179295B (en) Message processing method and device
CN108733545A (en) A kind of method for testing pressure and device
CN113900939A (en) Test environment access method and device, readable storage medium and computer equipment
CN116781564B (en) Network detection method, system, medium and electronic equipment of container cloud platform
CN108345508B (en) Interface call testing method and device
CN116541461A (en) Data processing method, device, equipment and storage medium applied to database

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201013

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201013

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right