Skip to content
Merged
13 changes: 12 additions & 1 deletion .github/workflows/script/solo_smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ function start_contract_test ()
result=0
npm run hh:test || result=$?
cd -

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Test local network connection using nc"
sudo apt-get update && sudo apt-get install -y netcat-traditional
nc -zv 127.0.0.1 50211
fi

if [[ $result -ne 0 ]]; then
echo "Smart contract test failed with exit code $result"
log_and_exit $result
Expand Down Expand Up @@ -159,6 +166,11 @@ function log_and_exit()
cat relay.log || true
echo "------- END RELAY DUMP -------"

echo "------- BEGIN MIRROR REST DUMP -------"
kubectl get services -n "${SOLO_NAMESPACE}" --output=name | grep rest | grep -v '\-restjava' | xargs -IREST kubectl logs -n "${SOLO_NAMESPACE}" REST > rest.log || true
cat rest.log || true
echo "------- END MIRROR REST DUMP -------"

echo "------- Last port-forward check -------" >> port-forward.log
ps -ef |grep port-forward >> port-forward.log

Expand Down Expand Up @@ -193,7 +205,6 @@ fi
create_test_account "${SOLO_DEPLOYMENT}"
clone_smart_contract_repo
setup_smart_contract_test
start_background_transactions
check_port_forward
start_contract_test
start_sdk_test "${REALM_NUM}" "${SHARD_NUM}"
Expand Down
8 changes: 4 additions & 4 deletions examples/create-topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function main() {
console.log(`topic id = ${createReceipt.topicId.toString()}`);

console.log('Wait to create subscribe to new topic');
await sleep(25000);
await sleep(3000);

// Create a subscription to the topic
const mirrorClient = (await Client.forMirrorNetwork(mirrorNetwork)).setOperator(
Expand All @@ -84,8 +84,6 @@ async function main() {
let finished = false;
new TopicMessageQuery()
.setTopicId(createReceipt.topicId)
.setMaxAttempts(400)
.setLimit(1)
// eslint-disable-next-line no-unused-vars
.subscribe(
mirrorClient,
Expand All @@ -103,6 +101,8 @@ async function main() {
},
);

await sleep(3000);

// send one message
let topicMessageSubmitTransaction = await new TopicMessageSubmitTransaction({
topicId: createReceipt.topicId,
Expand Down Expand Up @@ -150,7 +150,7 @@ async function main() {
});
});
req.on('error', e => {
console.log(`problem with request: ${e.message}`);
console.log(`problem with request, message = : ${e.message} cause = : ${e.cause}`);
});
req.end(); // make the request
// wait and try again
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/commands/tests/mirror-node-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ export class MirrorNodeTest extends BaseCommandTest {
const transactionsEndpoint: string = 'http://localhost:5551/api/v1/transactions';
const firstResponse = await fetch(transactionsEndpoint);
const firstData = await firstResponse.json();
await sleep(Duration.ofSeconds(10));
console.log(`firstData = ${JSON.stringify(firstData, null, 2)}`);
await sleep(Duration.ofSeconds(15));
const secondResponse = await fetch(transactionsEndpoint);
const secondData = await secondResponse.json();
console.log(`secondData = ${JSON.stringify(secondData, null, 2)}`);
expect(firstData.transactions).to.not.be.undefined;
expect(firstData.transactions.length).to.be.gt(0);
expect(secondData.transactions).to.not.be.undefined;
Expand Down
Loading