Skip to content

Commit 91aaa00

Browse files
authored
Merge pull request talaia-labs#74 from sr-gi/minor-fixes
Minor fixes re: tests and logs
2 parents f30ee8a + b0e169a commit 91aaa00

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/workflows/cln-plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ jobs:
6161
- name: Run tests
6262
run: |
6363
cd watchtower-plugin/tests
64-
DEVELOPER=1 poetry run pytest test.py -s
64+
DEVELOPER=1 SLOW_MACHINE=1 poetry run pytest test.py -s

teos/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ async fn main() {
304304
}));
305305
}
306306

307+
log::info!("Tower ready");
307308
chain_monitor.monitor_chain().await;
308309

309310
// Wait until shutdown

teos/src/tls.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ fn generate_or_load_identity(
7676
&key_path
7777
);
7878
let keypair = KeyPair::generate(&rcgen::PKCS_ECDSA_P256_SHA256)?;
79-
//
8079
std::fs::write(&key_path, keypair.serialize_pem())?;
8180
log::debug!(
8281
"Generating a new certificate for key {:?} at {:?}",
@@ -106,7 +105,6 @@ fn generate_or_load_identity(
106105
Some(ca) => cert.serialize_pem_with_signer(&Certificate::try_from(ca)?)?,
107106
},
108107
)?;
109-
log::info!("writing certificate to file");
110108
}
111109

112110
let key = std::fs::read(&key_path)?;

watchtower-plugin/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def start(self, overwrite_key=False):
8080
if overwrite_key:
8181
self.cmd_line.append("--overwritekey")
8282
TailableProc.start(self)
83-
self.wait_for_log("Bootstrap completed. Turning on interfaces", timeout=TIMEOUT)
83+
self.wait_for_log("Tower ready", timeout=TIMEOUT)
8484
logging.info("TeosD started")
8585

8686
def stop(self):

watchtower-plugin/tests/test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ def test_unreachable_watchtower(node_factory, bitcoind, teosd):
104104
assert l2.rpc.gettowerinfo(tower_id)["status"] == "temporary_unreachable"
105105
assert l2.rpc.gettowerinfo(tower_id)["pending_appointments"]
106106

107-
# Start the tower and check the automatic backoff works
107+
# Start the tower and check the automatic backoff works (wait while are pending appointments)
108108
teosd.start()
109-
time.sleep(max_interval_time * 2)
109+
while l2.rpc.gettowerinfo(tower_id)["pending_appointments"]:
110+
time.sleep(1)
111+
110112
assert l2.rpc.gettowerinfo(tower_id)["status"] == "reachable"
111113
assert not l2.rpc.gettowerinfo(tower_id)["pending_appointments"]
112114

0 commit comments

Comments
 (0)