[bisq-network/bisq] Add LongRunningTradesTest to apitest (#5303)

Stan notifications at github.com
Sun Mar 14 17:20:23 CET 2021


This new api testcase can run a long series of regtest trades by looping over modified `TakeBuyBTCOfferTest` and `TakeSellBTCOfferTest` cases.  The purpose is to help reproduce problems and isolate bugs Bisq's core and api layers.

`LongRunningTradesTest` is not enabled by default;  it will not run in a default test environment (such a Travis CI).  Enviornment variable `LONG_RUNNING_TRADES_TEST_ENABLED` must exist for the test to run. The env variable can be set in a bash shell before running the test case in a shell (using a gradle command), or the environment variable can be set in an Intellij test launcher's `Environment variables` field.

The modifed (short running) `TakeBuyBTCOfferTest` and `TakeSellBTCOfferTest` cases run as before.

Changes include:

- Add `static boolean isLongRunningTest` to `AbstractOfferTest`.

- Add looping control Supplier `maxTradeStateAndPhaseChecks` to `AbstractTradeTest`.  It uses the `isLongRunningTest` flag in the superclass to help define the wait times for trade state/phase changes during short and long running tests.

- Made `AbstractTradeTest assert(true, trade.isDepositPublished)` conditional upon `isLongRunningTest` value.  Long running trade test asserts have to be looser due to increasing latency of wallet, offer and trade operations in the server as the trade counts increase.

- Overload `ApiTestCase#startSupportingApps` with additional flag: `startSupportingAppsInDebugMode`. Default is false.  This makes starting background apps in debug mode a bit more convenient and self explanatory.

PR https://github.com/bisq-network/bisq/pull/5302 should be reviewed/merged before this one.

You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5303

-- Commit Summary --

  * Adjust protos for takeoffer error handing
  * Inject CoreContext into OpenOfferManager, adjust test
  * Adjust grpc & core services to new takeoffer error handling
  * Convert AvailabilityResult to error msg when takeoffer fails
  * Add missing grpc exception catch blocks
  * Derive AvailabilityResult from Task errorMessage
  * Merge branch 'master' into 01-fix-takeoffer-err-handling
  * Avoid NPE due to null fee while wrapping tx in TxInfo
  * Add LongRunningTradesTest

-- File Changes --

    M apitest/src/test/java/bisq/apitest/method/MethodTest.java (26)
    M apitest/src/test/java/bisq/apitest/method/offer/AbstractOfferTest.java (4)
    M apitest/src/test/java/bisq/apitest/method/trade/AbstractTradeTest.java (9)
    M apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java (204)
    M apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java (208)
    A apitest/src/test/java/bisq/apitest/scenario/LongRunningTradesTest.java (100)
    M cli/src/main/java/bisq/cli/GrpcClient.java (72)
    M core/src/main/java/bisq/core/api/CoreApi.java (7)
    M core/src/main/java/bisq/core/api/CoreTradesService.java (10)
    M core/src/main/java/bisq/core/api/model/TxInfo.java (70)
    M core/src/main/java/bisq/core/offer/AvailabilityResult.java (9)
    M core/src/main/java/bisq/core/offer/OpenOfferManager.java (12)
    M core/src/test/java/bisq/core/offer/OpenOfferManagerTest.java (72)
    A daemon/src/main/java/bisq/daemon/grpc/GrpcErrorMessageHandler.java (122)
    M daemon/src/main/java/bisq/daemon/grpc/GrpcExceptionHandler.java (19)
    M daemon/src/main/java/bisq/daemon/grpc/GrpcTradesService.java (35)
    M proto/src/main/proto/grpc.proto (1)
    M proto/src/main/proto/pb.proto (1)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5303.patch
https://github.com/bisq-network/bisq/pull/5303.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5303
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210314/01aa1c8d/attachment-0001.htm>


More information about the bisq-github mailing list