Skip to content

Conversation

@Sjors
Copy link
Member

@Sjors Sjors commented Mar 8, 2023

Some, but not all, backward compatibility tests fail for me and it seems useless to run old release binaries under valgrind anyway.

Can be tested by running test/functional/feature_txindex_compatibility.py --valgrind --timeout-factor=10 with and without this PR.


The previous version of this PR disabled these test entirely under valgrind. The current version does run the test, but starts the old binaries without valgrind.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 8, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK maflcko
Approach NACK luke-jr

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

No conflicts as of last run.

@Sjors
Copy link
Member Author

Sjors commented Mar 8, 2023

Example failure:

$ test/functional/feature_txindex_compatibility.py --valgrind --timeout-factor=4
2023-03-08T14:43:48.054000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_c2c_8427
2023-03-08T14:43:49.852000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 559, in start_nodes
    node.wait_for_rpc_connection()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_node.py", line 232, in wait_for_rpc_connection
    'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 133, in main
    self.setup()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 297, in setup
    self.setup_network()
  File "test/functional/feature_txindex_compatibility.py", line 39, in setup_network
    self.start_nodes()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 562, in start_nodes
    self.stop_nodes()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 577, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_node.py", line 344, in stop_node
    self.stop()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_node.py", line 190, in __getattr__
    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
2023-03-08T14:43:49.903000Z TestFramework (INFO): Stopping nodes
Traceback (most recent call last):
  File "test/functional/feature_txindex_compatibility.py", line 91, in <module>
    TxindexCompatibilityTest().main()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 157, in main
    exit_code = self.shutdown()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 313, in shutdown
    self.stop_nodes()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_framework.py", line 577, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_node.py", line 344, in stop_node
    self.stop()
  File "/home/sjors/dev/bitcoin/test/functional/test_framework/test_node.py", line 190, in __getattr__
    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
[node 2] Cleaning up leftover process
[node 1] Cleaning up leftover process
[node 0] Cleaning up leftover process

@maflcko
Copy link
Member

maflcko commented Mar 8, 2023

What about test/functional/mempool_compatibility.py etc?

@Sjors
Copy link
Member Author

Sjors commented Mar 8, 2023

For some reason that didn't fail. So an alternative could be to fix the ones that break for me, but not sure if that's worth the effort.

@Sjors Sjors changed the title test: skip backward compatibility tests under valgrind test: skip some backward compatibility tests under valgrind Mar 8, 2023
@maflcko
Copy link
Member

maflcko commented Mar 8, 2023

It might be more useful to disable them all here for the compat test only and instead run the full test suite on the guix binaries on release tags.

@fanquake
Copy link
Member

fanquake commented Mar 8, 2023

This seems arbitrary, and the can't run this test under valgrind message is not useful. I assume the first questions someone will have are going to be "Why can't I run this test under Valgrind?", "Does it need fixing then?" etc.

@maflcko
Copy link
Member

maflcko commented Mar 8, 2023

I presume the reason is that the valgrind supp file is not valid for previous releases. Actually, it might not even be valid for guix-compiled binaries on master?

@Sjors Sjors force-pushed the 2023/03/valgrind_prev_release branch from d1f6e7e to 5a0f71a Compare March 8, 2023 17:30
@Sjors
Copy link
Member Author

Sjors commented Mar 8, 2023

I disabled all tests that use previous releases under valgrind. Also tried a different error message.

"Does it need fixing then?"

I added a code comment and some more context to the commit to help answer that, if anyone does want to run these under valgrind.

Copy link
Member

Choose a reason for hiding this comment

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

nit: Might be a smaller diff, and more clear, if this was put into the skip_if_no_previous_releases function?

Copy link
Member Author

@Sjors Sjors Mar 8, 2023

Choose a reason for hiding this comment

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

Thought about that, but there may be other (future) tests we want to skip under valgrind (e.g. things that use a brittle dependency). Conversely, since some tests do work, maybe someone wants to enable one later.

Copy link
Member

Choose a reason for hiding this comment

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

Yea. If they are all going to be disabled in that case any way, no point duplicating all this logic and commentary.

Copy link
Member

Choose a reason for hiding this comment

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

(future) tests we want to skip under valgrind

Let's not worry about unwritten tests, that we apparently might not want to test properly for some arbitrary reason.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was also thinking existing tests, e.g. I haven't been able to run valgrind with BDB configured (didn't try very hard).

Copy link
Member

Choose a reason for hiding this comment

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

I was also thinking existing tests, e.g. I haven't been able to run valgrind with BDB configured (didn't try very hard).

It definitely works. The native valgrind CI job is already configured to run with BDB.

Copy link
Member

Choose a reason for hiding this comment

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

Conversely, since some tests do work, maybe someone wants to enable one later.

If you want to make it more fine grained, it could make sense to move the check to the test_node and condition it on the version number?

BDB

Good point. I also can't run --valgrind with BDB on my system. Which raises the question how many settings we want --valgrind to be supported under.

Copy link
Member

Choose a reason for hiding this comment

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

Which raises the question how many settings we want --valgrind to be supported under.

I thnk currently the only realistic place we can fully support Valgrind, is within the CI system, where things like BDB are working, and we can more easily control settings and suppressions. Outside of that, things may work fine, or may not at all, depending on the system where it is being run.

@Sjors Sjors changed the title test: skip some backward compatibility tests under valgrind test: skip all backward compatibility tests under valgrind Mar 8, 2023
Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

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

Approach NACK: Would prefer to run all the tests, but only execute the older binaries without Valgrind (ie, still run the current version with Valgrind)

@Sjors
Copy link
Member Author

Sjors commented Jun 27, 2023

Running the old binaries without valgrind makes sense. I'll see if I can figure out how.

@Sjors Sjors force-pushed the 2023/03/valgrind_prev_release branch from 5a0f71a to 3eb9bd7 Compare August 21, 2023 10:24
@Sjors Sjors changed the title test: skip all backward compatibility tests under valgrind test: exempt previous release binaries from valgrind Aug 21, 2023
@maflcko
Copy link
Member

maflcko commented Aug 21, 2023

lgtm ACK 3eb9bd7ccae6366eb548fa79cbdf78816354dc60

@Sjors
Copy link
Member Author

Sjors commented Aug 21, 2023

Changed this PR so that it now runs the old binaries without valgrind, rather than skipping the backward compatibility test entirely.

This is unnecessary and caused test failures. The backward
compatibility tests are meant to find regressions in the
current codebase, not to detect bugs in older releases.
@Sjors Sjors force-pushed the 2023/03/valgrind_prev_release branch from 3eb9bd7 to 850670e Compare October 12, 2023 07:26
@Sjors
Copy link
Member Author

Sjors commented Oct 12, 2023

Rebased.

@maflcko
Copy link
Member

maflcko commented Oct 12, 2023

lgtm ACK 850670e

@fanquake fanquake merged commit a927d5c into bitcoin:master Oct 12, 2023
@Sjors Sjors deleted the 2023/03/valgrind_prev_release branch October 12, 2023 09:58
Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Oct 13, 2023
…rind

850670e test: don't run old binaries under valgrind (Sjors Provoost)

Pull request description:

  Some, but not all, backward compatibility tests fail for me and it seems useless to run old release binaries under valgrind anyway.

  Can be tested by running `test/functional/feature_txindex_compatibility.py --valgrind --timeout-factor=10` with and without this PR.

  —
  The previous version of this PR disabled these test entirely under valgrind. The current version does run the test, but starts the old binaries without valgrind.

ACKs for top commit:
  maflcko:
    lgtm ACK 850670e

Tree-SHA512: ebdf461083f1292528e6619963b910f486b60b4f6b183f0aea2c8bfcafa98caeb204d138700cd288450643bcec5e49e12b89f2f7537fccdf495a2a33acd9cea0
@bitcoin bitcoin locked and limited conversation to collaborators Oct 11, 2024
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.

5 participants