Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit 2325e1d

Browse files
bors[bot]tomtau
andauthored
Merge #679
679: Problem: integration tests occasionally fail due to tx-query not started r=tomtau a=tomtau Solution: changed wait-for-it in docker compose to tx-query, as that may take the longest time to start up Co-authored-by: Tomas Tauber <[email protected]>
2 parents 321836b + 137a6c0 commit 2325e1d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

chain-tx-enclave/tx-query/app/src/test/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ pub fn test_integration() {
9898
let t = thread::spawn(move || {
9999
info!("Trying to launch TX Query server...");
100100
let enclave = start_enclave();
101-
tx.send(()).expect("Could not send signal on channel.");
102101
info!("Running TX Query server...");
103102

104103
let listener = TcpListener::bind(query_server_addr).expect("failed to bind the TCP socket");
105104

106105
for _ in 0..3 {
106+
tx.send(()).expect("Could not send signal on channel.");
107107
match listener.accept() {
108108
Ok((stream, addr)) => {
109109
info!("new client: {:?}", addr);
@@ -174,7 +174,7 @@ pub fn test_integration() {
174174
fail_exit(&mut validation);
175175
}
176176
}
177-
rx.recv().expect("Could not receive from channel.");
177+
rx.recv().expect("Could not receive from channel. 1");
178178
let c = DefaultTransactionObfuscation::new(
179179
format!("localhost:{}", query_server_port),
180180
"localhost".to_owned(),
@@ -238,8 +238,7 @@ pub fn test_integration() {
238238
}
239239
}
240240

241-
thread::sleep(time::Duration::from_secs(10));
242-
241+
rx.recv().expect("Could not receive from channel. 2");
243242
let txids = vec![*txid];
244243
let r1 = c.decrypt(
245244
txids.as_slice(),
@@ -255,6 +254,7 @@ pub fn test_integration() {
255254
fail_exit(&mut validation);
256255
}
257256
}
257+
rx.recv().expect("Could not receive from channel. 3");
258258
let r2 = c.decrypt(txids.as_slice(), &PrivateKey::new().expect("random key"));
259259
match r2 {
260260
Ok(v) => {

integration-tests/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
TX_VALIDATION_CONN: tcp://chain-tx-enclave:25933
4141
client-rpc:
4242
image: "${CHAIN_DOCKER_IMAGE:-integration-tests-chain}"
43-
command: /usr/bin/wait-for-it.sh tendermint:26657 --timeout=60 --strict -- /usr/bin/client-rpc --host=0.0.0.0 --port=26659 --chain-id=${CHAIN_ID} --storage-dir=/.storage --websocket-url=ws://tendermint:26657/websocket
43+
command: /usr/bin/wait-for-it.sh chain-tx-query-enclave:25944 --timeout=60 -- /usr/bin/client-rpc --host=0.0.0.0 --port=26659 --chain-id=${CHAIN_ID} --storage-dir=/.storage --websocket-url=ws://tendermint:26657/websocket
4444
volumes:
4545
- "./${WALLET_STORAGE_WITHFEE_DIRECTORY}:/.storage"
4646
environment:
@@ -88,7 +88,7 @@ services:
8888
TX_VALIDATION_CONN: tcp://chain-tx-enclave-zerofee:25933
8989
client-rpc-zerofee:
9090
image: "${CHAIN_DOCKER_IMAGE:-integration-tests-chain}"
91-
command: /usr/bin/wait-for-it.sh tendermint-zerofee:26657 --timeout=60 --strict -- /usr/bin/client-rpc --host=0.0.0.0 --port=26659 --chain-id=${CHAIN_ID} --storage-dir=/.storage --websocket-url=ws://tendermint-zerofee:26657/websocket
91+
command: /usr/bin/wait-for-it.sh chain-tx-query-enclave-zerofee:25944 --timeout=60 --strict -- /usr/bin/client-rpc --host=0.0.0.0 --port=26659 --chain-id=${CHAIN_ID} --storage-dir=/.storage --websocket-url=ws://tendermint-zerofee:26657/websocket
9292
volumes:
9393
- "./${WALLET_STORAGE_ZEROFEE_DIRECTORY}:/.storage"
9494
environment:

0 commit comments

Comments
 (0)