From e1af175707007591113b0d6fc56036782b0e347c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 4 Oct 2023 17:36:49 -0400 Subject: [PATCH] Enable most of the third `BuildResult` worker protocol test This was somewhat of a false alarm. The problem was not that the protocol implementation actually failed to round trip, but that two of the fields were ignored entirely --- not serialized and deserialized at all. For reference, those fields were added in fa68eb367e79297bb1c0451cd92ad18a06edce96. --- src/libstore/tests/worker-protocol.cc | 11 ++++++----- .../libstore/worker-protocol/build-result.bin | Bin 144 -> 744 bytes 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libstore/tests/worker-protocol.cc b/src/libstore/tests/worker-protocol.cc index 24a06503c..fa7cbe121 100644 --- a/src/libstore/tests/worker-protocol.cc +++ b/src/libstore/tests/worker-protocol.cc @@ -187,7 +187,7 @@ CHARACTERIZATION_TEST( "build-result", ({ using namespace std::literals::chrono_literals; - std::tuple t { + std::tuple t { BuildResult { .status = BuildResult::OutputRejected, .errorMsg = "no idea why", @@ -200,9 +200,6 @@ CHARACTERIZATION_TEST( .startTime = 30, .stopTime = 50, }, -#if 0 - // This is commented because this test would fail! - // FIXME uncomment this and fix the underlying bug. BuildResult { .status = BuildResult::Built, .timesBuilt = 1, @@ -230,10 +227,14 @@ CHARACTERIZATION_TEST( }, .startTime = 30, .stopTime = 50, +#if 0 + // These fields are not yet serialized. + // FIXME Include in next version of protocol or document + // why they are skipped. .cpuUser = std::chrono::milliseconds(500s), .cpuSystem = std::chrono::milliseconds(604s), - }, #endif + }, }; t; })) diff --git a/unit-test-data/libstore/worker-protocol/build-result.bin b/unit-test-data/libstore/worker-protocol/build-result.bin index f981fd91f7f32724dc2b9ce1938398aad3d73cdf..b02c706eab8de4d60eadd6afdcc2c888ab605ad3 100644 GIT binary patch literal 744 zcmc(b&uRiO5XSolPxTp!=B%)rxXHS&(2IC2JXe~O6CwQ^%woR?}>#sX4il$bfs;n zmv%`YOQ~vvTo;t-%xH@l(n4vSK8bRZQHc`kI^B)Ih0TkNGRhXy8rqZN5BnYj(ieFo zAJ+t*u7l`;??iPt&V)lzi91dfGZFf@g4iVAZN4+jUVRU7o>ol_o!fedeM@Pl_mAVf T^ROZOQyyvZZF!s