Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Regression: Add ZMQ tests #1730

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

DyrellC
Copy link
Contributor

@DyrellC DyrellC commented Jan 27, 2020

Description

Add to the current tests to account for zmq topic publishing. It is intended to catch any breaking changes to zmq publishing of transaction and milestone data.

Fixes #1598

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How Has This Been Tested?

  • Tests were run locally to ensure zmq steps work in the different machines that they have been added to

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also check the values of the zmq responses?
Also you are missing Address

There are 2 nits that you may do if you feel like

Comment on lines 55 to 59
|keys |
|sn |
|sn_trytes |
|tx |
|tx_trytes |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can easily check for values here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly, these transactions are just created and sent out so the transaction hashes and trytes are not hardcoded anywhere. I'd have to move the test to a different machine that uses a hardcoded transaction, which can be problematic because the sn and sn_trytes require the transaction to be solidified, which requires a milestone to be issued. So either I write a new scenario just for this part, or I rewrite one of the other tests to accommodate that.

Comment on lines 49 to 50
while scan_sockets:
if len(poller.poll(timeout=1000)) != 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
You can make this simplet by doing while len(poller.poll(timeout=1000)) != 0: I believe.
Then you have less variables and ifs

contains_response = False
for arg in keys:
if received[0].decode() == arg:
contains_response = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
Maybe add a break?
You can claim that this is short anyhows and better have less lines of code 🤷‍♂️
So only do this change if you feel it is correct.

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you also testing the address topic?
I missed it...

Anyhows, I am good with your changes, suppose we are waiting for the container side fix?


Then "storeTransactions" is called on "nodeA-m2" with:
|keys |values |type |
|trytes |TRANSACTION_TEST_TRANSACTION_TRYTES |staticList |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you make new trytes/static vals here? Couldnt we just reuse TEST_TRYTES/EMPTY_TRYTES?

@acha-bill acha-bill mentioned this pull request Feb 27, 2020
4 tasks
@GalRogozinski
Copy link
Contributor

@DyrellC let's update this test with #1772 and merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test ZMQ topics
3 participants