ed6b88a12d
The upload code currently updates the usage in a deferred call to saveOrder(). The consequence is that in the success case, the RPC is completed before the usage has been updated. This change repurposes the deferred call to update usage in the failure case, while explicitly updating the usage before completing the RPC. This fixes some test flakiness when using dRPC. gRPC waits until the final status is written before a Recv call completes, and the final status is written by the server after the handler function has exited. In practice this means that the client is blocked until the defer call is also finished. So this change will not change performance at all. It has two advantages: (1) It fixes test flakiness and, more importantly: (2) reduces the chances that someone will accidentally write a flaky test in the future |
||
---|---|---|
.. | ||
endpoint_test.go | ||
endpoint.go | ||
serials_test.go | ||
serials.go | ||
verification_test.go | ||
verification.go |