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)
Wed, Oct 2, 1:07 PM
Unknown Object (File)
Wed, Oct 2, 1:07 PM
Unknown Object (File)
Wed, Oct 2, 1:07 PM
Unknown Object (File)
Wed, Oct 2, 1:07 PM
Unknown Object (File)
Wed, Oct 2, 6:01 AM
Unknown Object (File)
Mon, Sep 23, 10:34 AM
Unknown Object (File)
Mon, Sep 16, 4:57 AM
Unknown Object (File)
Sat, Sep 7, 1:50 AM
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
No Lint Coverage
Unit
No Test Coverage

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

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