Merge pull request #74 from sr-gi/minor-fixes

Minor fixes re: tests and logs
This commit is contained in:
Sergi Delgado Segura 2022-07-11 17:07:32 +02:00 committed by GitHub
commit 91aaa00a99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

View file

@ -61,4 +61,4 @@ jobs:
- name: Run tests
run: |
cd watchtower-plugin/tests
DEVELOPER=1 poetry run pytest test.py -s
DEVELOPER=1 SLOW_MACHINE=1 poetry run pytest test.py -s

View file

@ -304,6 +304,7 @@ async fn main() {
}));
}
log::info!("Tower ready");
chain_monitor.monitor_chain().await;
// Wait until shutdown

View file

@ -76,7 +76,6 @@ fn generate_or_load_identity(
&key_path
);
let keypair = KeyPair::generate(&rcgen::PKCS_ECDSA_P256_SHA256)?;
//
std::fs::write(&key_path, keypair.serialize_pem())?;
log::debug!(
"Generating a new certificate for key {:?} at {:?}",
@ -106,7 +105,6 @@ fn generate_or_load_identity(
Some(ca) => cert.serialize_pem_with_signer(&Certificate::try_from(ca)?)?,
},
)?;
log::info!("writing certificate to file");
}
let key = std::fs::read(&key_path)?;

View file

@ -80,7 +80,7 @@ class TeosD(TailableProc):
if overwrite_key:
self.cmd_line.append("--overwritekey")
TailableProc.start(self)
self.wait_for_log("Bootstrap completed. Turning on interfaces", timeout=TIMEOUT)
self.wait_for_log("Tower ready", timeout=TIMEOUT)
logging.info("TeosD started")
def stop(self):

View file

@ -104,9 +104,11 @@ def test_unreachable_watchtower(node_factory, bitcoind, teosd):
assert l2.rpc.gettowerinfo(tower_id)["status"] == "temporary_unreachable"
assert l2.rpc.gettowerinfo(tower_id)["pending_appointments"]
# Start the tower and check the automatic backoff works
# Start the tower and check the automatic backoff works (wait while are pending appointments)
teosd.start()
time.sleep(max_interval_time * 2)
while l2.rpc.gettowerinfo(tower_id)["pending_appointments"]:
time.sleep(1)
assert l2.rpc.gettowerinfo(tower_id)["status"] == "reachable"
assert not l2.rpc.gettowerinfo(tower_id)["pending_appointments"]