Page MenuHomePhabricator

[Tunnelbroker] add recipient confirmation tests
ClosedPublic

Authored by kamil on Oct 24 2023, 10:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 9:53 AM
Unknown Object (File)
Sat, Nov 9, 8:58 AM
Unknown Object (File)
Sat, Nov 9, 8:50 AM
Unknown Object (File)
Sat, Nov 9, 4:58 AM
Unknown Object (File)
Sat, Nov 9, 4:45 AM
Unknown Object (File)
Fri, Oct 18, 9:02 PM
Unknown Object (File)
Oct 5 2024, 5:24 AM
Unknown Object (File)
Oct 2 2024, 1:07 PM
Subscribers

Details

Summary

Tests to make sure it works properly and the message is deleted only after confirmation.

Depends on D9577

Test Plan
  1. Run tests
  2. Make sure DDB is empty after running tests.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Oct 24 2023, 11:21 AM

Why aren't you testing the following scenario?

  1. Receive message
  2. Send confirmation
  3. Restart connection
  4. Don't receive a message

I guess its due to pt 4 - we cannot check if websocket is empty without hacky ways like timeouts

One more test worth considering is to send confirmation twice.

  1. Receive a message
  2. Send confirmation
    • Message should be deleted from DDB
  3. Send confirmation again
    • Deleting a non-existent DDB message should not cause an error
  4. Connection should still be active (not dropped by tunnelbroker)

One test worth considering is to send confirmation twice.

  1. Receive a message
  2. Send confirmation
    • Message should be deleted from DDB
  3. Send confirmation again
    • Deleting a non-existent DDB message should not cause an error
  4. Connection should still be active (not dropped by tunnelbroker)

Good suggestion 🙏

add test with sending confirmation twice

Why aren't you testing the following scenario?

  1. Receive message
  2. Send confirmation
  3. Restart connection
  4. Don't receive a message

I guess its due to pt 4 - we cannot check if websocket is empty without hacky ways like timeouts

yes, that's the case

[...] I guess its due to pt 4 - we cannot check if websocket is empty without hacky ways like timeouts

Could we do something like this:

  1. Send message
  2. Receive message
  3. Send confirmation
  4. Restart connection for receiver
  5. Send another message
  6. Receive only the second message
services/commtest/tests/tunnelbroker_recipient_confirmation_tests.rs
39–46 ↗(On Diff #32542)

Slightly cleaner (also applies to tests below)

This revision is now accepted and ready to land.Nov 2 2023, 6:09 AM
  • add one more tests
  • early exit

[...] I guess its due to pt 4 - we cannot check if websocket is empty without hacky ways like timeouts

Could we do something like this:

  1. Send message
  2. Receive message
  3. Send confirmation
  4. Restart connection for receiver
  5. Send another message
  6. Receive only the second message

makes sense, added