aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_uacomment.py2
-rwxr-xr-xtest/functional/mempool_persist.py9
-rwxr-xr-xtest/functional/rpc_rawtransaction.py4
-rwxr-xr-xtest/functional/test_runner.py14
-rwxr-xr-xtest/functional/wallet_zapwallettxes.py1
5 files changed, 15 insertions, 15 deletions
diff --git a/test/functional/feature_uacomment.py b/test/functional/feature_uacomment.py
index 0b2c64ab69..bc3791508a 100755
--- a/test/functional/feature_uacomment.py
+++ b/test/functional/feature_uacomment.py
@@ -23,7 +23,7 @@ class UacommentTest(BitcoinTestFramework):
self.log.info("test -uacomment max length")
self.stop_node(0)
- expected = "Total length of network version string (286) exceeds maximum length (256). Reduce the number or size of uacomments."
+ expected = "exceeds maximum length (256). Reduce the number or size of uacomments."
self.assert_start_raises_init_error(0, ["-uacomment=" + 'a' * 256], expected)
self.log.info("test -uacomment unsafe characters")
diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py
index 31a96ec60e..17f0967219 100755
--- a/test/functional/mempool_persist.py
+++ b/test/functional/mempool_persist.py
@@ -66,16 +66,17 @@ class MempoolPersistTest(BitcoinTestFramework):
self.log.debug("Stop-start the nodes. Verify that node0 has the transactions in its mempool and node1 does not. Verify that node2 calculates its balance correctly after loading wallet transactions.")
self.stop_nodes()
+ self.start_node(1) # Give this one a head-start, so we can be "extra-sure" that it didn't load anything later
self.start_node(0)
- self.start_node(1)
self.start_node(2)
# Give bitcoind a second to reload the mempool
- time.sleep(1)
- wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
- wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5)
+ wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5, timeout=1)
+ wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5, timeout=1)
+ # The others have loaded their mempool. If node_1 loaded anything, we'd probably notice by now:
assert_equal(len(self.nodes[1].getrawmempool()), 0)
# Verify accounting of mempool transactions after restart is correct
+ self.nodes[2].syncwithvalidationinterfacequeue() # Flush mempool to wallet
assert_equal(node2_balance, self.nodes[2].getbalance())
self.log.debug("Stop-start node0 with -persistmempool=0. Verify that it doesn't load its mempool.dat file.")
diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py
index d39d86b310..c2ca7c70b8 100755
--- a/test/functional/rpc_rawtransaction.py
+++ b/test/functional/rpc_rawtransaction.py
@@ -59,6 +59,10 @@ class RawTransactionsTest(BitcoinTestFramework):
self.nodes[0].generate(5)
self.sync_all()
+ # Test getrawtransaction on genesis block coinbase returns an error
+ block = self.nodes[0].getblock(self.nodes[0].getblockhash(0))
+ assert_raises_rpc_error(-5, "The genesis block coinbase is not considered an ordinary transaction", self.nodes[0].getrawtransaction, block['merkleroot'])
+
# Test `createrawtransaction` required parameters
assert_raises_rpc_error(-1, "createrawtransaction", self.nodes[0].createrawtransaction)
assert_raises_rpc_error(-1, "createrawtransaction", self.nodes[0].createrawtransaction, [])
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 98944685e1..c670878d68 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -472,21 +472,15 @@ class TestResult():
def check_script_prefixes():
- """Check that at most a handful of the
- test scripts don't start with one of the allowed name prefixes."""
-
- # LEEWAY is provided as a transition measure, so that pull-requests
- # that introduce new tests that don't conform with the naming
- # convention don't immediately cause the tests to fail.
- LEEWAY = 10
+ """Check that test scripts start with one of the allowed name prefixes."""
good_prefixes_re = re.compile("(example|feature|interface|mempool|mining|p2p|rpc|wallet)_")
bad_script_names = [script for script in ALL_SCRIPTS if good_prefixes_re.match(script) is None]
- if len(bad_script_names) > 0:
- print("INFO: %d tests not meeting naming conventions:" % (len(bad_script_names)))
+ if bad_script_names:
+ print("%sERROR:%s %d tests not meeting naming conventions:" % (BOLD[1], BOLD[0], len(bad_script_names)))
print(" %s" % ("\n ".join(sorted(bad_script_names))))
- assert len(bad_script_names) <= LEEWAY, "Too many tests not following naming convention! (%d found, maximum: %d)" % (len(bad_script_names), LEEWAY)
+ raise AssertionError("Some tests are not following naming convention!")
def check_script_list(src_dir):
diff --git a/test/functional/wallet_zapwallettxes.py b/test/functional/wallet_zapwallettxes.py
index 08afb87894..87f44b2737 100755
--- a/test/functional/wallet_zapwallettxes.py
+++ b/test/functional/wallet_zapwallettxes.py
@@ -59,6 +59,7 @@ class ZapWalletTXesTest (BitcoinTestFramework):
self.start_node(0, ["-persistmempool=1", "-zapwallettxes=2"])
wait_until(lambda: self.nodes[0].getmempoolinfo()['size'] == 1, timeout=3)
+ self.nodes[0].syncwithvalidationinterfacequeue() # Flush mempool to wallet
assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1)
assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2)