[uploader] Avoid spinning on inbound requests

resultstore.go:
Changed receive on inboundRequestQueue to check for channel closure
by testing for a nil value (instead of ok-probing).
This effectively makes the channel block and wait for close().
Same in the for-loop that is paired with a periodic flush -- this
avoids polling.  As before, closing this
channel is the way to stop Run() gracefully.

utils_for_test.go:
fakeResultStoreServer now records RPC requests for comparison
in tests.

resultstore_test.go:
add wanted requests to test case structure.
add missing Serve() call.
add test case that excersises CreateInvocation only,
which looks like an interrupted build.
add test case with complete successful build.
Compare unpacked sequence of UploadRequests because batch size
can be variable and non-deterministic, due to timing.
Validate the continuity between authorization and resume tokens
in UploadBatchRequests.

Bug: 369980343

Change-Id: I79d449af28ba14759ceed1b19421b6ae9dad75f5
Reviewed-on: https://fuchsia-review.googlesource.com/c/rsclient/+/1360685
Commit-Queue: David Fang <fangism@google.com>
Reviewed-by: Jay Zhuang <jayzhuang@google.com>
3 files changed
tree: 09b79277f19ab299db917e14df556c0b4e26edfe
  1. cmd/
  2. internal/
  3. scripts/
  4. tools/
  5. .bazelversion
  6. .gitignore
  7. AUTHORS
  8. BUILD.bazel
  9. CONTRIBUTING.md
  10. go.mod
  11. go.sum
  12. LICENSE
  13. MODULE.bazel
  14. OWNERS
  15. PATENTS
  16. README.md
  17. version.bzl
README.md

ResultStore Client Tools

The rsclient repository contains tools that support the use of ResultStore services and API.

rsproxy acts as a bridge between build tools and the ResultStore service.

The first supported build tool is Fuchsia's fork of ninja.

Developing from source

Prerequisites

  • rsclient builds with Bazel. We recommend using Bazelisk to use the version of Bazel currently supported by this code base.

rsclient is supported for Linux, and is yet untested on other platforms.

Setup

Before working with the code base, we recommend installing the precommit hook once per git clone with:

./scripts/install_precommit.sh

This runs a variety of checks and automatic regeneration steps for you before committing local changes.

Building

To build everything:

$ bazelisk build ...

Testing

To run tests:

$ bazelisk test ...

Install

Versioning

Not yet applicable.

Releases

Not yet applicable.