Merge bitcoin/bitcoin#27137: test: Raise PRNG seed log to INFO

4d84eaec82e7b5a450d47cd30e5936a717035f77 Raise PRNG seed log to INFO. (roconnor-blockstream)

Pull request description:

  Some build infrastructure, such as Nix, will delete failed builds by default, keeping only the log (stdout/stderr) of the failed build.

  For flaky tests, it would be very helpful to have the PRNG seed in the default log in order to redo the failed test.

  By simply raising the PRNG seed logging to INFO, we can, by default, record the seed in the log of every build.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 4d84eaec82e7b5a450d47cd30e5936a717035f77
  theStack:
    ACK 4d84eaec82e7b5a450d47cd30e5936a717035f77

Tree-SHA512: 3ccb4a4e7639a3babc3b2a6456a6d0bffc090da34e4545b317f7bfbed4e9950d1b38ea5b2a90c37ccb49b3454bdeff03a6aaf86770b9c4dd14b26320aba50b94
This commit is contained in:
fanquake 2023-02-22 17:49:01 +00:00 committed by pasta
parent bba215031b
commit c66c0fdbf8
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38

View File

@ -305,10 +305,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if seed is None: if seed is None:
seed = random.randrange(sys.maxsize) seed = random.randrange(sys.maxsize)
else: else:
self.log.debug("User supplied random seed {}".format(seed)) self.log.info("User supplied random seed {}".format(seed))
random.seed(seed) random.seed(seed)
self.log.debug("PRNG seed is: {}".format(seed)) self.log.info("PRNG seed is: {}".format(seed))
self.log.debug('Setting up network thread') self.log.debug('Setting up network thread')
self.network_thread = NetworkThread() self.network_thread = NetworkThread()