Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix connection event race condition in present proof test #620

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ class ConnectionSteps {
fun inviterReceivesTheConnectionRequest(inviter: Actor) {
wait(
{
val lastEvent = ListenToEvents.`as`(inviter).connectionEvents.last()
lastEvent.data.thid == inviter.recall<String>("thid") &&
val lastEvent = ListenToEvents.`as`(inviter).connectionEvents.lastOrNull()
lastEvent != null && lastEvent.data.thid == inviter.recall<String>("thid") &&
lastEvent.data.state == ConnectionState.CONNECTION_RESPONSE_SENT
},
"Inviter connection didn't reach ${ConnectionState.CONNECTION_RESPONSE_SENT} state",
Expand All @@ -114,8 +114,8 @@ class ConnectionSteps {
// Bob (Holder) receives final connection response
wait(
{
val lastEvent = ListenToEvents.`as`(invitee).connectionEvents.last()
lastEvent.data.thid == invitee.recall<String>("thid") &&
val lastEvent = ListenToEvents.`as`(invitee).connectionEvents.lastOrNull()
lastEvent != null && lastEvent.data.thid == invitee.recall<String>("thid") &&
lastEvent.data.state == ConnectionState.CONNECTION_RESPONSE_RECEIVED
},
"Invitee connection didn't reach ${ConnectionState.CONNECTION_RESPONSE_RECEIVED} state.",
Expand Down
Loading