[archivist] Fix tests for CTF

This test has been mysteriously failing in CTF but passing at HEAD for
the last few API rolls, and we now know why.

At API level HEAD we default the format for Inspect reads to CBOR which
is more efficient, but not yet formally stabilized. At levels < HEAD,
however, we default to JSON which is less space efficient.

The truncation test sets the maximum byte size to 4000 bytes, which
gives 1333 bytes for each of the 3 components that are being read. This
happens to fit the CBOR content, but not the JSON content. Whenever we
roll a new API level we create a version of this test that requests the
JSON content which becomes fully truncated (similar to the case where we
set the maximum size to 1 byte).

This change creates a new method on the ArchiveReader to set the read
format. If that method is not called we revert to the default FORMAT as
before. The test now includes a new read that checks that whatever
number we pick can fit a JSON response too, and we set the maximum
aggregated size to 8000 instead of 4000 since that is enough to fit
either JSON or CBOR.

Fixed: 383560524
Change-Id: Ibe75ce0532f0c4dc161d1c2ae0a723d416ef4b29
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1609931
Reviewed-by: Brian Bosak <bbosak@google.com>
3 files changed
tree: c3d9cc86280fc98c50a62d178485ad30ea8a0bff
  1. .gemini/
  2. .helix/
  3. boards/
  4. build/
  5. bundles/
  6. docs/
  7. examples/
  8. manifests/
  9. products/
  10. scripts/
  11. sdk/
  12. src/
  13. third_party/
  14. tools/
  15. zircon/
  16. .clang-format
  17. .clang-tidy
  18. .cursorignore
  19. .editorconfig
  20. .geminiignore
  21. .git-blame-ignore-revs
  22. .gitattributes
  23. .gitignore
  24. .gitmodules
  25. .gn
  26. .ignore
  27. analysis_options.yaml
  28. AUTHORS
  29. BUILD.gn
  30. CODE_OF_CONDUCT.md
  31. CONTRIBUTING.md
  32. fuchsia.code-workspace
  33. GEMINI.md
  34. LICENSE
  35. OWNERS
  36. PATENTS
  37. pyproject.toml
  38. pyrightconfig.json
  39. README.md
  40. rustfmt.toml
  41. shac.star
  42. shac.textproto
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.