Skip to content

Commit

Permalink
[Test] Replace time waiting with message submission waiting (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne authored Mar 9, 2024
1 parent a7b4b0b commit 3d117c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions e2e/tests/session.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ Feature: Session Namespace
Scenario: Supplier completes claim/proof lifecycle for a valid session
Given the user has the pocketd binary installed
When the supplier "supplier1" has serviced a session with "5" relays for service "svc1" for application "app1"
# TODO_TECHDEBT: Once the session grace period is configurable, set it to 0 at the beginning of this test.
# The timeout for when a claim can be submitted on-chain depends on `createClaimWindowStartHeight`, which
# is a function of `SessionGracePeriod`. The higher this value, the higher this timeout needs to be. Since
# this test is not dependant on the grace period, setting it to 0 and having a lower grace period will simplify it.
And the user should wait for "7" seconds
And the user should wait for the "proof" "CreateClaim" Message to be submited
Then the claim created by supplier "supplier1" for service "svc1" for application "app1" should be persisted on-chain
# TODO_IMPROVE: And an event should be emitted...
And after the supplier submits a proof for the session for service "svc1" for application "app1"
Expand Down
5 changes: 5 additions & 0 deletions e2e/tests/session_steps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ const (
preExistingProofsKey = "preExistingProofsKey"
)

// TODO_TECHDEBT: Evaluate if/where/how this function should be reused in other tests
func (s *suite) TheUserShouldWaitForTheMessageToBeSubmited(module, message string) {
s.waitForMessageAction(fmt.Sprintf("/poktroll.%s.Msg%s", module, message))
}

func (s *suite) AfterTheSupplierCreatesAClaimForTheSessionForServiceForApplication(serviceId, appName string) {
s.waitForMessageAction("/poktroll.proof.MsgCreateClaim")
}
Expand Down

0 comments on commit 3d117c2

Please sign in to comment.