Conversation
|
PASS [ 43.246s] (3/3) lit_node::test toxiproxy::perf_tests::load_with_no_latency |
DashKash54
left a comment
There was a problem hiding this comment.
Left a comment regarding the test
| async fn test_payment_tracker_usage_tracking() { | ||
| // This test verifies that: | ||
| // 1. Pricing increases with concurrency (usage percentage) | ||
| // 2. After requests complete, usage tracking correctly returns to 0% |
There was a problem hiding this comment.
We should also be verifying that the usage decreases regardless of the error status of the requests i.e. even if the request throws an exception?
There was a problem hiding this comment.
sure, but how do i throw an exception? we patch all the exceptions as we find them, haha.
| resource_ability_requests.clone(), | ||
| Some(self_pay_user.wallet.clone()), | ||
| None, | ||
| Some(initial_price), |
There was a problem hiding this comment.
Since the nodes are receiving multiple requests concurrently the max_price should be increased to account for the price increase otherwise the requests will fail?
| // Give some time for all guards to drop and deregister | ||
| tokio::time::sleep(tokio::time::Duration::from_secs(2)).await; | ||
|
|
||
| // Check that price has returned to initial (or close to it) |
There was a problem hiding this comment.
This is a pretty simple test so we should rather assert for absolute zero instead of tolerance by just waiting longer say 10 sec?
Use the RAII pattern to automatically deregister payment usage when the request goes out of scope and it's variables are dropped