Bitcoin: Functional test error when modifying RPC response: “RPC key returned that was not in doc”

Analysis Oshbok: Swing Functional Test from Bitcoin Core RPC Odvet

As a delay, it is designed that at the stage of the testing of the project they are frequently enlarged with the problems. We do not assess the non -disjuctic scrap in our functional tests for the functioning of the Bitcoin RPC kernel. In this state, we will ulce into the details of the problems and give the presentation about what it is to decide.

Problem

Our functional dust package on the Eastern Answer RPC, submitted API Bitcoin Core. However, from the change in our database of the data code, the exit is no longer appropriate to the fact of the fact. This non -sophistication free the tester’s crash, calling unnatural modification and potential regression.

Combining Osh

After the more inferior trustees of the oblivion, it becomes clear that the problem is concluded in that we check the RPC key in the attachment of the comments. Current coexisting:

`

“He returned the RPC key, which was not in the doctor”

`

This is indicated by the fact that the “key” parameter, transferred to our dust function, does not meet as the documentary RPC.

solving

To solve this problem, we should disperse our code base that it is rightly to replicate the RPC. We can do this:

1

2

3

Here’s a preferential prior that we can change our code to resolve this problem:

`Piton

Import

Class Testfunctionaltets (Unittest.tescase):

DEF Configuration (Self):

self.rpc_Response = {

"Klucz": "Weder_rpc_key",

"Response_data": {"weder_Response_data": "Weder_Response"}

}

Def Test_functional_test (Self):

UPOLEST AGAINED ATTEM RPC B CHIOD BE OUR FUND

Weder_Response = self.rpc_Response ["Response_data"]

Verify the extended comments to the document

If "Doc_comment" on self.rpc_ressponse:

Asert Wajewanne_Response == Self.rpc_Response ["doc_comment"]

In the production medium we will replace it with a false RPC

Realizing this change, we can kill that our functional tenses are more appropriate and talked, the decline of the faithfulness of the false or the perpetration of regression.

Enjoyment

The submarine is, in this state, the important problem is shaken in our functional packeting testing for the function of modification of the Otveta on the basis bitcoin. Ponima base of the problem, we smooth the flakes, in which we have to disperse our database, to make it more appropriate and the testening. In this change, we can significantly extend the attachment and the ability to subjugate the functional techniques of our project.

The best techniques are the testing from Bitcoin Core

Bitcoin: Functional test error when modifying RPC response:

To do more than to extend the renewedness of the dust pack:

* Use the very high data

: Create the very testive lighting light, which imitated the extended response of the interface API, not to be flooded on the real calls of the RPC.

* At the right of the doctors : Keeping that your prenzia is a contencies and correctly confirmed into the attitude of the comments to the document for each RPC.

* Test isolation : isolation of test functions to reduce the inflammation of the exites or change in the database.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *