Skip to content

Commit f054600

Browse files
rustyrussellShahanaFarooqui
authored andcommitted
pytest: fix flake in test_setconfig_access.
We were supposed to put the sqlite db in a different directory, but the test was wrong! So occasionally we would crash with: ``` Failed to commit DB transaction: Failed to commit a transaction: disk I/O error ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent fb0f62e commit f054600

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_misc.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4338,15 +4338,16 @@ def test_setconfig(node_factory, bitcoind):
43384338
assert lines == ["# Created and update by setconfig, but you can edit this manually when node is stopped.", "min-capacity-sat=400000"]
43394339

43404340

4341-
def test_setconfig_access(node_factory, bitcoind, db_provider):
4341+
def test_setconfig_access(node_factory, bitcoind):
43424342
"""Test that we correctly fail (not crash) if config file/dir not writable"""
43434343

43444344
# Disable bookkeeper, with its separate db which gets upset under CI.
43454345
options = {'disable-plugin': 'bookkeeper'}
43464346

43474347
# sqlite3 gets upset if the directory is non-writable when it tries to commit.
4348-
if db_provider == 'sqlite3':
4349-
options['wallet'] = os.path.join(node_factory.directory, 'l1.sqlite3')
4348+
if os.getenv('TEST_DB_PROVIDER', 'sqlite3') == 'sqlite3':
4349+
options['wallet'] = 'sqlite3://' + os.path.join(node_factory.directory, 'l1.sqlite3')
4350+
43504351
l1 = node_factory.get_node(options=options)
43514352

43524353
netconfigfile = os.path.join(l1.daemon.opts.get("lightning-dir"), TEST_NETWORK, 'config')

0 commit comments

Comments
 (0)