Page MenuHomePhabricator

[alias-server] Add live test script for parsing all tx history with the API
AbandonedPublic

Authored by bytesofman on Mar 16 2023, 17:58.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Summary

T2966

Depends on D13353

Add a test script to test new partial tx history functions against a live chronik API. These are critical functions. While well mocked unit tests exist, I think it's important to have a script that actually fires on the live API (even if this probably should not be integrated into CI).

Test Plan

npm test
npm run live and review output (all tests should pass)
Register a few aliases and wait for tx confirmation
npm run live and review output (all tests should still pass)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22747
Build 45114: Build Diff
Build 45113: arc lint + arc unit

Event Timeline

Updating comments in live test script

emack requested changes to this revision.Mar 18 2023, 03:05
emack added a subscriber: emack.

image.png (562×924 px, 107 KB)

running npm run live, Is this a rate limiting issue since you're hitting it live?

This revision now requires changes to proceed.Mar 18 2023, 03:05

image.png (562×924 px, 107 KB)

running npm run live, Is this a rate limiting issue since you're hitting it live?

Do you get this every time? For example, if you modify the script to only do one live test? To do this, change fetchAliasesAndTestApi() at bottom of aliasTestsLive.js to fetchAliasesAndTestApi(false, 1)

Weird. I have not seen it but it does look like some kind of rate limit issue.

Here's my output for the the live tests, pulling this part of the stack

image.png (267×1 px, 64 KB)

Could you provide the full chronik error?

Try npm run live > testLog.log and share in telegram

Here's my output for the the live tests, pulling this part of the stack

image.png (267×1 px, 64 KB)

Could you provide the full chronik error?

Try npm run live > testLog.log and share in telegram

same log as shared in tg or D13361 just then

Using promise.all for npm run live script and adding debug logging

Reduce default number of tests to prevent overload errors for some users

emack requested changes to this revision.Mar 28 2023, 06:21

The tests are now all passing however the outputs don't seem right.

i.e.

  • I ran npm run live the first time and it had 503 unprocesses txs
  • then I registered 2 more aliases and waited for them to be confirmed
  • re-ran npm run live and it has now jumped to 648 unprocesses txs

image.png (313×862 px, 59 KB)

If you check the explorer for the payment address there has only been 2 txs inside the hour.

image.png (498×992 px, 143 KB)

This revision now requires changes to proceed.Mar 28 2023, 06:21

The tests are now all passing however the outputs don't seem right.

i.e.

  • I ran npm run live the first time and it had 503 unprocesses txs
  • then I registered 2 more aliases and waited for them to be confirmed
  • re-ran npm run live and it has now jumped to 648 unprocesses txs

image.png (313×862 px, 59 KB)

If you check the explorer for the payment address there has only been 2 txs inside the hour.

image.png (498×992 px, 143 KB)

The script is selecting a random amount of "unprocessed" txs from the total set of txs every time. So it will always be a different number.

I a diff later in this stack, I add the case of "all txs are unprocessed" every time, so that this constant case is always tested. But that isn't here yet.

This revision is now accepted and ready to land.Mar 28 2023, 22:58