Skip to content

Commit b26b50c

Browse files
Reduce data propagation waiting time in integration tests
Signed-off-by: Alexander Shenshin <[email protected]>
1 parent c8f3e2f commit b26b50c

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

tests/integration/demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def test_demo(self, client: Client):
9393
)
9494

9595
# Wait until changes are propagated to Hedera Mirror node
96-
await asyncio.sleep(10)
96+
await asyncio.sleep(5)
9797

9898
# Create Hedera DID resolver instance
9999
did_resolver = HederaDidResolver(client)
@@ -135,7 +135,7 @@ async def test_demo(self, client: Client):
135135
)
136136

137137
# Wait until changes are propagated to Hedera Mirror node
138-
await asyncio.sleep(10)
138+
await asyncio.sleep(5)
139139

140140
print("Resolving schema object...")
141141

@@ -174,7 +174,7 @@ async def test_demo(self, client: Client):
174174
)
175175

176176
# Wait until changes are propagated to Hedera Mirror node
177-
await asyncio.sleep(10)
177+
await asyncio.sleep(5)
178178

179179
print("Resolving credential definition object...")
180180

@@ -224,7 +224,7 @@ async def test_demo(self, client: Client):
224224
)
225225

226226
# Wait until changes are propagated to Hedera Mirror node
227-
await asyncio.sleep(10)
227+
await asyncio.sleep(5)
228228

229229
print("Resolving revocation registry definition object...")
230230

@@ -257,7 +257,7 @@ async def test_demo(self, client: Client):
257257
rev_list_timestamp = int(time.time())
258258

259259
# Wait until changes are propagated to Hedera Mirror node
260-
await asyncio.sleep(10)
260+
await asyncio.sleep(5)
261261

262262
print(
263263
f"Revocation list has been registered, initial revocation entry can be found in HCS topic: https://hashscan.io/testnet/topic/{rev_reg_entries_topic_id}"
@@ -281,7 +281,7 @@ async def test_demo(self, client: Client):
281281
assert rev_list_update_result.revocation_list_state.state == "finished"
282282

283283
# Wait until changes are propagated to Hedera Mirror node
284-
await asyncio.sleep(10)
284+
await asyncio.sleep(5)
285285

286286
print("Resolving revocation list states...")
287287

tests/integration/test_hcs_file_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def test_submit_and_resolve_file(
3333
topic_id = await service.submit_file(file_payload, OPERATOR_KEY_DER)
3434

3535
# Wait until changes are propagated to Hedera Mirror node
36-
await asyncio.sleep(10)
36+
await asyncio.sleep(5)
3737

3838
topic_info = await execute_hcs_query_async(TopicInfoQuery(topic_id=TopicId.from_string(topic_id)), client)
3939
topic_messages = await HcsMessageResolver(topic_id, HcsFileChunkMessage).execute(client)

tests/integration/test_hedera_anoncreds_registry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async def test_creates_anoncreds_schema(self, client: Client, Something):
9292
assert parsed_identifier.object_type == AnonCredsObjectType.SCHEMA
9393

9494
# Wait until changes are propagated to Hedera Mirror node
95-
await asyncio.sleep(10)
95+
await asyncio.sleep(5)
9696

9797
resolution_result = await registry.get_schema(schema_id)
9898

@@ -124,7 +124,7 @@ async def test_creates_anoncreds_cred_def(self, client: Client, Something):
124124
assert parsed_identifier.object_type == AnonCredsObjectType.PUBLIC_CRED_DEF
125125

126126
# Wait until changes are propagated to Hedera Mirror node
127-
await asyncio.sleep(10)
127+
await asyncio.sleep(5)
128128

129129
resolution_result = await registry.get_cred_def(cred_def_id)
130130

@@ -159,7 +159,7 @@ async def test_creates_anoncreds_rev_reg_def(self, client: Client, Something):
159159
assert parsed_identifier.object_type == AnonCredsObjectType.REV_REG
160160

161161
# Wait until changes are propagated to Hedera Mirror node
162-
await asyncio.sleep(10)
162+
await asyncio.sleep(5)
163163

164164
resolution_result = await registry.get_rev_reg_def(rev_reg_def_id)
165165

@@ -182,7 +182,7 @@ async def test_creates_and_updates_rev_list(self, client: Client, Something):
182182
assert rev_reg_def_id
183183

184184
# Wait until changes are propagated to Hedera Mirror node
185-
await asyncio.sleep(10)
185+
await asyncio.sleep(5)
186186

187187
rev_list = AnonCredsRevList(
188188
issuer_id=ISSUER_ID,
@@ -205,7 +205,7 @@ async def test_creates_and_updates_rev_list(self, client: Client, Something):
205205
assert rev_reg_entries_topic_id
206206

207207
# Wait until changes are propagated to Hedera Mirror node
208-
await asyncio.sleep(10)
208+
await asyncio.sleep(5)
209209

210210
entries_messages = await HcsMessageResolver(rev_reg_entries_topic_id, HcsRevRegEntryMessage).execute(client)
211211

@@ -240,7 +240,7 @@ async def test_creates_and_updates_rev_list(self, client: Client, Something):
240240
)
241241

242242
# Wait until changes are propagated to Hedera Mirror node
243-
await asyncio.sleep(10)
243+
await asyncio.sleep(5)
244244

245245
entries_messages = await HcsMessageResolver(rev_reg_entries_topic_id, HcsRevRegEntryMessage).execute(client)
246246

tests/integration/test_hedera_did.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async def test_deletes_did_document(self, client: Client):
159159
assert did.topic_id
160160

161161
# Wait until changes are propagated to Hedera Mirror node
162-
await asyncio.sleep(10)
162+
await asyncio.sleep(5)
163163

164164
did_document = await did.resolve()
165165

@@ -574,7 +574,7 @@ async def test_adds_new_verification_method(self, client: Client):
574574
)
575575

576576
# Wait until changes are propagated to Hedera Mirror node
577-
await asyncio.sleep(10)
577+
await asyncio.sleep(5)
578578

579579
did_document = await did.resolve()
580580

tests/integration/test_hedera_did_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async def test_returns_success_response(self, client: Client, Something):
6060
assert did.identifier
6161

6262
# Wait until changes are propagated to Hedera Mirror node
63-
await asyncio.sleep(10)
63+
await asyncio.sleep(5)
6464

6565
result = await HederaDidResolver(client).resolve(did.identifier)
6666

@@ -106,7 +106,7 @@ async def test_returns_deactivated_document(self, client: Client):
106106
assert did.identifier
107107

108108
# Wait until changes are propagated to Hedera Mirror node
109-
await asyncio.sleep(10)
109+
await asyncio.sleep(5)
110110

111111
result = await HederaDidResolver(client).resolve(did.identifier)
112112

tests/unit/hcs/hcs_file/test_hcs_file_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async def test_throws_on_resolving_invalid_topic_id(
135135
service = HcsFileService(mock_client)
136136
with pytest.raises(
137137
Exception,
138-
match="Invalid TopicId format. Expected 'shard.realm.num'",
138+
match="Invalid topic ID string 'invalid_topic_id'. Expected format 'shard.realm.num'.",
139139
):
140140
await service.resolve_file("invalid_topic_id")
141141

tests/unit/hcs/test_hcs_topic_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def mock_topic_create_transaction(mocker: MockerFixture):
1717
MockTopicCreateTransaction = mocker.patch("hiero_did_sdk_python.hcs.hcs_topic_service.TopicCreateTransaction")
1818

1919
mock_transaction_response = mocker.MagicMock()
20-
mock_transaction_response.topicId.__str__.return_value = MOCK_TOPIC_ID
20+
mock_transaction_response.topic_id.__str__.return_value = MOCK_TOPIC_ID
2121
mock_transaction_response.status = ResponseCode.SUCCESS
2222

2323
mock_topic_create_transaction = MockTopicCreateTransaction.return_value
@@ -33,7 +33,7 @@ def mock_topic_update_transaction(mocker: MockerFixture):
3333
MockTopicUpdateTransaction = mocker.patch("hiero_did_sdk_python.hcs.hcs_topic_service.TopicUpdateTransaction")
3434

3535
mock_transaction_response = mocker.MagicMock()
36-
mock_transaction_response.topicId.__str__.return_value = MOCK_TOPIC_ID
36+
mock_transaction_response.topic_id.__str__.return_value = MOCK_TOPIC_ID
3737
mock_transaction_response.status = ResponseCode.SUCCESS
3838

3939
mock_topic_update_transaction = MockTopicUpdateTransaction.return_value

0 commit comments

Comments
 (0)