upstream: a diagnostics episode follows health, and a peer fault carries its cause
Gates / frontend (push) Successful in 2m5s
Gates / test (push) Successful in 2m43s
Gates / test-aarch64 (push) Successful in 8m19s
Gates / package (push) Successful in 4m21s
Gates / container (push) Successful in 13s
CI / gates (push) Successful in 30m43s
Gates / frontend (push) Successful in 2m5s
Gates / test (push) Successful in 2m43s
Gates / test-aarch64 (push) Successful in 8m19s
Gates / package (push) Successful in 4m21s
Gates / container (push) Successful in 13s
CI / gates (push) Successful in 30m43s
This commit is contained in:
+7
-9
@@ -1520,18 +1520,16 @@ const AnsweringClient = struct {
|
||||
io: std.Io,
|
||||
query: []const u8,
|
||||
response_buf: []u8,
|
||||
selected: *?[]const u8,
|
||||
) transport.ExchangeError![]u8 {
|
||||
) transport.LeafError!transport.Outcome {
|
||||
_ = io;
|
||||
_ = query;
|
||||
const self: *AnsweringClient = @ptrCast(@alignCast(ptr));
|
||||
_ = self.calls.fetchAdd(1, .acq_rel);
|
||||
selected.* = "fake://leaf";
|
||||
@memcpy(response_buf[0..reply.len], reply);
|
||||
return response_buf[0..reply.len];
|
||||
return .{ .reply = response_buf[0..reply.len] };
|
||||
}
|
||||
|
||||
fn client(self: *AnsweringClient) transport.Client {
|
||||
fn leaf(self: *AnsweringClient) transport.Leaf {
|
||||
return .{ .ptr = self, .exchangeFn = exchangeFn };
|
||||
}
|
||||
};
|
||||
@@ -1546,10 +1544,10 @@ test "the queue families carry what a real pool recorded, through the real snaps
|
||||
defer threaded.deinit();
|
||||
const io = threaded.io();
|
||||
|
||||
var leaf: AnsweringClient = .{};
|
||||
var answering: AnsweringClient = .{};
|
||||
var slots = [_]pool_mod.Slot{
|
||||
.{ .client = leaf.client() },
|
||||
.{ .client = leaf.client() },
|
||||
.{ .client = answering.leaf() },
|
||||
.{ .client = answering.leaf() },
|
||||
};
|
||||
var recoveries: std.atomic.Value(u64) = .init(0);
|
||||
var entries = [_]pool_mod.Entry{.{
|
||||
@@ -1569,7 +1567,7 @@ test "the queue families carry what a real pool recorded, through the real snaps
|
||||
var buf: [512]u8 = undefined;
|
||||
var selected: ?[]const u8 = null;
|
||||
_ = try pool.exchange(io, "\x12\x34\x01\x00", &buf, &selected);
|
||||
try testing.expectEqual(@as(u32, 1), leaf.calls.load(.acquire));
|
||||
try testing.expectEqual(@as(u32, 1), answering.calls.load(.acquire));
|
||||
|
||||
// The counters a burst would move, written straight into the entry: this
|
||||
// test is about what the snapshot path carries, not about reproducing a
|
||||
|
||||
Reference in New Issue
Block a user