Skip to content

Commit 66610b9

Browse files
- increase the expiration time from 8 to 16 seconds for the last test and added some additional checks
1 parent b94461e commit 66610b9

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

hedera-mirror-test/src/test/java/com/hedera/mirror/test/e2e/acceptance/steps/ScheduleFeature.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,19 @@ public class ScheduleFeature extends AbstractFeature {
7171
"I successfully schedule a HBAR transfer from treasury to {account} with expiration time {string} and wait for expiry {string}")
7272
public void createNewHBarTransferSchedule(
7373
AccountNameEnum accountName, String expirationTimeInSeconds, String waitForExpiry) {
74-
Instant expirationTime = null;
75-
76-
if (expirationTimeInSeconds != null && !expirationTimeInSeconds.equals("null")) {
77-
Duration expirationOffset = DurationStyle.detectAndParse(expirationTimeInSeconds);
78-
expirationTime = Instant.now().plus(expirationOffset);
79-
}
80-
81-
currentSignersCount = SIGNATORY_COUNT_OFFSET;
74+
currentSignersCount = SIGNATORY_COUNT_OFFSET;
8275
var recipient = accountClient.getAccount(accountName);
8376
var scheduledTransaction = accountClient.getCryptoTransferTransaction(
8477
accountClient.getTokenTreasuryAccount().getAccountId(),
8578
recipient.getAccountId(),
8679
Hbar.fromTinybars(DEFAULT_TINY_HBAR));
8780

81+
Instant expirationTime = null;
82+
if (expirationTimeInSeconds != null && !expirationTimeInSeconds.equals("null")) {
83+
Duration expirationOffset = DurationStyle.detectAndParse(expirationTimeInSeconds);
84+
expirationTime = Instant.now().plus(expirationOffset);
85+
}
86+
8887
createNewSchedule(scheduledTransaction, expirationTime, Boolean.parseBoolean(waitForExpiry));
8988
}
9089

@@ -103,6 +102,12 @@ public void waitForScheduleToExpire() {
103102
} catch (Exception e) {
104103
log.info("Dummy transaction fails but triggers the schedule execution");
105104
}
105+
106+
//Wait until the transaction is executed and has a valid executed timestamp
107+
await().atMost(Duration.ofSeconds(30))
108+
.pollDelay(Duration.ofMillis(100))
109+
.pollInterval(Duration.ofMillis(100))
110+
.untilAsserted(() -> assertThat(mirrorClient.getScheduleInfo(scheduleId.toString()).getExecutedTimestamp()).isNotNull());
106111
}
107112

108113
private void createNewSchedule(Transaction<?> transaction, Instant expirationTime, boolean waitForExpiry) {

hedera-mirror-test/src/test/resources/features/schedule/schedule.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Feature: Schedule Base Coverage Feature
1919
When the scheduled transaction is signed by treasuryAccount
2020
And the mirror node REST API should return status <httpStatusCode> for the schedule transaction
2121
And the mirror node REST API should verify the "EXECUTED" schedule entity with expiration time "60s" and wait for expiry "false"
22-
Given I successfully schedule a HBAR transfer from treasury to ALICE with expiration time "8s" and wait for expiry "true"
22+
Given I successfully schedule a HBAR transfer from treasury to ALICE with expiration time "16s" and wait for expiry "true"
2323
Then the mirror node REST API should return status <httpStatusCode> for the schedule transaction
24-
And the mirror node REST API should verify the "NON_EXECUTED" schedule entity with expiration time "8s" and wait for expiry "true"
24+
And the mirror node REST API should verify the "NON_EXECUTED" schedule entity with expiration time "16s" and wait for expiry "true"
2525
When the scheduled transaction is signed by treasuryAccount
2626
And the mirror node REST API should return status <httpStatusCode> for the schedule transaction
2727
Then I wait until the schedule's expiration time
28-
And the mirror node REST API should verify the "EXECUTED" schedule entity with expiration time "8s" and wait for expiry "true"
28+
And the mirror node REST API should verify the "EXECUTED" schedule entity with expiration time "16s" and wait for expiry "true"
2929

3030
Examples:
3131
| httpStatusCode |

0 commit comments

Comments
 (0)