Skip to content

Conversation

ccdle12
Copy link
Contributor

@ccdle12 ccdle12 commented Mar 31, 2018

PR for #12453

New contributor looking at mainly the 'good first issues'.

From my understanding of the issue:

  • Track the iteration level of loop when test fails in Travis CI

Further clarification on the issue would be greatly appreciated to narrow down what can be fixed or updated.

@fanquake fanquake added the Tests label Mar 31, 2018
@@ -380,6 +380,8 @@ def test_nonnull_locators(self, test_node, inv_node):
# PART 3. Headers announcements can stop after large reorg, and resume after
# getheaders or inv from peer.
for j in range(2):
self.log.info("Part 3: iteration level: {}".format(j))

Copy link
Member

@maflcko maflcko Mar 31, 2018

Choose a reason for hiding this comment

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

I'd slightly prefer if the comments in the loops down there were transformed into debug statements. (Where we check for i == ... and j == ...)

@@ -406,6 +408,8 @@ def test_nonnull_locators(self, test_node, inv_node):
test_node.wait_for_block(new_block_hashes[-1])

for i in range(3):
self.log.debug("Part 3: i == {}".format(i))

# Mine another block, still should get only an inv
Copy link
Member

Choose a reason for hiding this comment

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

What I meant was to transfer those comments from # ... to self.log.debug(...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh sorry, I think I get what you mean now

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

Thanks for your first contribution @ccdle12!

I'm not sure if you've dropped a commit, but this PR isn't doing what the comments suggest.

A couple of nits inline.

@@ -381,7 +381,7 @@ def test_nonnull_locators(self, test_node, inv_node):
# getheaders or inv from peer.
for j in range(2):
# First try mining a reorg that can propagate with header announcement
new_block_hashes = self.mine_reorg(length=7)
new_block_hashes = self.mine_reorg(length=7)
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've added trailing whitespace here.

@@ -412,11 +412,13 @@ def test_nonnull_locators(self, test_node, inv_node):
test_node.check_last_announcement(inv=[tip], headers=[])
if i == 0:
# Just get the data -- shouldn't cause headers announcements to resume
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this comment now that you have a log saying the same thing!

Same for comments lower down.

Copy link
Contributor Author

@ccdle12 ccdle12 Apr 2, 2018

Choose a reason for hiding this comment

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

Thanks @jnewbery, I appreciate the patience for a newbie, have pushed a new commit removing the comments above the debug prints.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

"files.associations": {
"*.ipp": "cpp"
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Unwanted file?

@@ -411,21 +411,18 @@ def test_nonnull_locators(self, test_node, inv_node):
inv_node.check_last_announcement(inv=[tip], headers=[])
test_node.check_last_announcement(inv=[tip], headers=[])
if i == 0:
# Just get the data -- shouldn't cause headers announcements to resume
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this as well.

Changing logs to debug level and format of statment to j == ...

Updating debug statements to include comments when checking for iteration level of i and j

Removing comments above log prints in Part 3

Removing unwanted file

Added log prints in loops in p2p_sendheaders
@ccdle12 ccdle12 force-pushed the tests-adding-logging-in-p2p_sendheaders branch from 1709160 to 8dd547d Compare April 2, 2018 22:52
@jnewbery
Copy link
Contributor

jnewbery commented Apr 3, 2018

As it stands, this doesn't seem to be that useful. It'll print out the same log many times over as it iterates over i and j.

@maflcko
Copy link
Member

maflcko commented Apr 3, 2018

utACK 8dd547d. Seems like a tiny improvement over what it was before.

@maflcko maflcko merged commit 8dd547d into bitcoin:master Apr 7, 2018
maflcko pushed a commit that referenced this pull request Apr 7, 2018
8dd547d Adding logging for loop iteration level in p2p_sendheaders.py (ccdle12)

Pull request description:

  PR for #12453

  New contributor looking at mainly the 'good first issues'.

  From my understanding of the issue:
   * Track the iteration level of loop when test fails in Travis CI

  Further clarification on the issue would be greatly appreciated to narrow down what can be fixed or updated.

Tree-SHA512: 228524aad54c09979d990a0fc6818e13a11e1ab5e78b606b892e897bba7b1e09bf25447feb631049e45ac017eeb61fbf1c1f11e8bd5103648f976a05099ba9f9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 16, 2020
8dd547d Adding logging for loop iteration level in p2p_sendheaders.py (ccdle12)

Pull request description:

  PR for bitcoin#12453

  New contributor looking at mainly the 'good first issues'.

  From my understanding of the issue:
   * Track the iteration level of loop when test fails in Travis CI

  Further clarification on the issue would be greatly appreciated to narrow down what can be fixed or updated.

Tree-SHA512: 228524aad54c09979d990a0fc6818e13a11e1ab5e78b606b892e897bba7b1e09bf25447feb631049e45ac017eeb61fbf1c1f11e8bd5103648f976a05099ba9f9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 18, 2020
8dd547d Adding logging for loop iteration level in p2p_sendheaders.py (ccdle12)

Pull request description:

  PR for bitcoin#12453

  New contributor looking at mainly the 'good first issues'.

  From my understanding of the issue:
   * Track the iteration level of loop when test fails in Travis CI

  Further clarification on the issue would be greatly appreciated to narrow down what can be fixed or updated.

Tree-SHA512: 228524aad54c09979d990a0fc6818e13a11e1ab5e78b606b892e897bba7b1e09bf25447feb631049e45ac017eeb61fbf1c1f11e8bd5103648f976a05099ba9f9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants