Skip to content

Keep the read-and-reply toll test inside the network reward window #85

Open

Description

@dnlbui

Problem

In Actions run 37319184103, should receive toll on read and on reply failed all three attempts. The replies were accepted, but were sent after the network's 60-second reward window, so the test incorrectly expected the reply reward.

The initial-message-to-reply transaction timestamp differences were 60,333 ms, 60,502 ms, and 60,837 ms. Expected final balance: 52.437500; actual: 49.343750. The missing 3.093750 LIB matches the taxed half-toll reward. The server's reward deadline starts at the original message timestamp, not when it is read.

Location and cause

playwright-tests/tests/multiUser.e2e.test.js, test should receive toll on read and on reply:

await sendMessageTo(pg2, user1, msg2);
await pg1.waitForTimeout(10_000);
await checkReceivedMessage(pg1, user2, msg2);
// wallet navigation...
await pg1.waitForTimeout(20_000);
// check read reward, then reply
await sendMessageTo(pg1, user2, replyMsg);

sendMessageTo() also waits ten seconds for chat initialization before sending. Together, fixed pauses, navigation, and transaction processing consume the reward window. This is a test timing problem; the observed server behavior is consistent with the configured deadline.

Resolution

  • Wait for the received message through the existing bounded UI assertion instead of sleeping before checking it.
  • Poll the expected read-reward balance using the existing wallet helper, then reply immediately after it is confirmed.
  • Poll the final balance to verify the reply reward instead of an unconditional post-reply sleep.
  • Preserve the full-precision toll setup and separate exact six-decimal assertions for both rewards.
  • Keep shared chat readiness safeguards and unrelated tests unchanged.

Acceptance

Run this test repeatedly against https://liberdus.com/dev/ with retries disabled. Both reward assertions must pass; inspect transaction timing to ensure the reply is comfortably inside the reward window. Stack the fix above test/settle-attachment-menu-scroll, then rebase test/retain-failure-diagnostics onto the fix.

This is the immediate fix: unlike the other three intermittent findings from this run, it failed every attempt.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions