-
Notifications
You must be signed in to change notification settings - Fork 200
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: some improvements #1754
test: some improvements #1754
Conversation
Signed-off-by: Timo Glastra <timo@animo.id>
9a043d0
to
54ae02b
Compare
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
3ea5a38
to
90b661f
Compare
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great additions here! This pre-creation of AnonCreds objects will significantly reduce the risks of tests failing due to timeout errors (apart from making them faster, as you've already benchmarked).
I've left some minor comments, nothing really significant besides a doubt I have regarding the closing of WsOutboundTransport
that may introduce issues if works as I remember it did in nodejs environment (probably it has changed since the time I checked).
@@ -109,5 +129,33 @@ export async function e2eTest({ | |||
|
|||
// We want to stop the mediator polling before the agent is shutdown. | |||
await recipientAgent.mediationRecipient.stopMessagePickup() | |||
await sleep(2000) | |||
|
|||
const pickupRequestMessages = [V2DeliveryRequestMessage.type.messageTypeUri, V1BatchPickupMessage.type.messageTypeUri] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not completely sure, but maybe the new "MessagePickupCompleted" event can help on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so yes, but we would still need to hook into the sent event to catch the thread id that was used for the last sent message.
I think we should probably also hook the initateMessagePickup into this and the subscription from initiateMessagePickup so stopMessagePickup
will return when the message pickup is fully complete. If a pickup message has just been sent, it should wait for the delivery message before resolving. I think if we can do that in a follow up, It'll allow us to clean up quite some test logic related to shutting down at the correct time
Signed-off-by: Timo Glastra <timo@animo.id>
Merging for now. Thanks for the feedback! We can improve the pickup finished handling in a follow up PR (if we add the right handles in the |
We're having a lot of issues with tests randomly failing. I think the issue is in the in memory wallet being faster (espeically in closing etc..) and therefore the closing / shutdown after tests is now going wrong when we use message pickup.
This PR adds some small improvements, but I think the proper way to fix this is by keeping track of which pickup messages we have sent, and waiting for a response to the sent messages after stopMessagePickup has been called. That way we know for sure no more messages will be exchanged before we call
shutdown
on the agents.Partially fixes #1750 It moves more to in-memory. splits e2e from non-e2e, splits non-e2e into shards (2 at the moment) to speed up tests. And I made a first pass at using pre-generated anoncreds definitions in tests. The tests i did this for were significantly faster