fix(admin): name both Unraid space steps in the storage tooltip and test the render node 507

The Unraid share tooltip told users only to map the share's array view to
/space. With CHRONOS_SPACE_PATH unset (the shipped docker-compose file, or a
template whose Space path was cleared) the server never looks at /space, so
following the tip changed nothing. The tip (en, it) and BRIEF 14.8 now also
say to set CHRONOS_SPACE_PATH=/space; the English text was shortened to stay
within the 200-character tooltip budget.

A render node completing its result on a full archive volume answers 507
before the upload moves to Committing, but no test covered that path. The new
VolumeSpaceTests case checks that the upload keeps receiving with its chunks
and the node keeps the job, then that the same call succeeds once there is
room.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-26 23:20:03 +01:00
1 parent a34b33d50b
commit d43df50572
5 files changed
+50 -7

No files matched your search

@@ -12,7 +12,7 @@ namespace Chronos.Server.Tests.Jobs;
[Category("server")]
public sealed class RenderNodeTests(TestContext context)
{
private static readonly string HevcJob = JsonSerializer.Serialize(
internal static readonly string HevcJob = JsonSerializer.Serialize(
new RenderJobParameters("4K HEVC", """{"codec":"hevc","bitrate":60}""", "hevc", 3840, 2160, UseProxies: false, null), ProtocolJson.Default.RenderJobParameters);
[Test]
@@ -147,7 +147,7 @@ public sealed class RenderNodeTests(TestContext context)
new RenderJobParameters("H.264", """{"preset":{"isAuto":false,"manual":"4k-h264"}}""", "h264", width, height, UseProxies: false, null),
ProtocolJson.Default.RenderJobParameters);
private static async Task<RenderNodeDto> RegisterAsync(HttpClient client, string name, string codec, int maxWidth)
internal static async Task<RenderNodeDto> RegisterAsync(HttpClient client, string name, string codec, int maxWidth)
{
using var response = await client.PostAsJsonAsync("/api/v1/nodes/register",
new RegisterNodeRequest(name, [new NodeEncoder(codec, codec.ToUpperInvariant() + " encoder", true, false)], maxWidth, maxWidth), ProtocolJson.Default.RegisterNodeRequest);
@@ -6,6 +6,7 @@ using Microsoft.Extensions.Logging;
using Chronos.Protocol;
using Chronos.Server.Configuration;
using Chronos.Server.Storage;
using Chronos.Server.Tests.Jobs;
using Chronos.Testing;
namespace Chronos.Server.Tests.Storage;
@@ -251,6 +252,48 @@ public sealed class VolumeSpaceTests(TestContext context)
await room.ExpectAsync(HttpStatusCode.OK);
}
[Test]
public async Task AFullArchiveVolumeRefusesARenderNodeResultUntilThereIsRoom()
{
await using var server = await TestServer.StartAsync(context, o => o.ChunkSizeBytes = 64 * 1024, s =>
{
s.AddSingleton<FakeVolumeSpace>();
s.AddSingleton<VolumeSpace>(sp => sp.GetRequiredService<FakeVolumeSpace>());
});
var volumes = server.Services.GetRequiredService<FakeVolumeSpace>();
var (editor, _, _) = await server.UserAsync("alberto", "editor", renderNode: true);
var frame = await Uploads.UploadAsync(editor, Uploads.Photo(5000, 73), "IMG_0001.CR3");
var job = await JobApiTests.CreateAsync(editor, "render", frame.SequenceId, RenderNodeTests.HevcJob);
var node = await RenderNodeTests.RegisterAsync(editor, "studio-pc", "hevc", 8192);
using (var claim = await editor.PostAsync($"/api/v1/nodes/{node.Id}/claim", null)) await claim.ExpectAsync(HttpStatusCode.OK);
var output = Uploads.Photo(3000, 74);
var request = new RenderResultRequest("Roof - 4K HEVC.mp4", output.Length, Uploads.Sha(output), "4K HEVC", "hevc", 3840, 2160, 25, 120);
using var started = await editor.PostAsJsonAsync($"/api/v1/nodes/{node.Id}/jobs/{job.Id}/result", request, ProtocolJson.Default.RenderResultRequest);
await started.ExpectAsync(HttpStatusCode.Created);
var upload = Assert.NotNull((await started.ReadAsync(ProtocolJson.Default.StartUploadResponse)).UploadId);
using (var put = await Uploads.PutChunkAsync(editor, upload, 0, output)) await put.ExpectAsync(HttpStatusCode.OK);
// Refused before the commit starts: the upload keeps receiving with its chunks and the node keeps the job.
var complete = $"/api/v1/nodes/{node.Id}/jobs/{job.Id}/result/complete";
volumes.Set(server.Options.ArchivePath, new VolumeFigures(0, 500 * GB));
using (var full = await editor.PostAsync(complete, null))
await full.ExpectErrorAsync(HttpStatusCode.InsufficientStorage, "insufficient_storage");
Assert.Equal(Chronos.Data.Repositories.UploadState.Receiving, Assert.NotNull(await server.Database.Uploads.FindByJobAsync(job.Id)).State);
Assert.True(server.Services.GetRequiredService<UploadStore>().Exists(upload));
var waiting = await JobApiTests.GetAsync(editor, job.Id);
Assert.Equal(("running", node.Id.ToString()), (waiting.State, waiting.NodeId));
volumes.Set(server.Options.ArchivePath, null);
using (var room = await editor.PostAsync(complete, null))
{
await room.ExpectAsync(HttpStatusCode.OK);
Assert.Equal("studio-pc", (await room.ReadAsync(ProtocolJson.Default.RenderDto)).ProducedBy);
}
Assert.Equal("done", (await JobApiTests.GetAsync(editor, job.Id)).State);
Assert.Equal(Chronos.Data.Repositories.UploadState.Committed, Assert.NotNull(await server.Database.Uploads.FindByJobAsync(job.Id)).State);
}
[Test]
public void TheSpacePathComesFromTheFileOrTheEnvironment()
{