diff --git a/platform/service/job_channel.go b/platform/service/job_channel.go index 3a006ae..4561ebf 100644 --- a/platform/service/job_channel.go +++ b/platform/service/job_channel.go @@ -611,7 +611,7 @@ func firstEligibleSupportedJob(jobs []domain.Job, capabilities []string, stamp t if !eligible || !job.CancelRequestedAt.IsZero() { continue } - if len(capabilitySet) > 0 && !isServerFileCapability(job.Capability) { + if len(capabilitySet) > 0 { if _, supported := capabilitySet[job.Capability]; !supported { continue } diff --git a/platform/service/job_channel_test.go b/platform/service/job_channel_test.go index a443b69..0941279 100644 --- a/platform/service/job_channel_test.go +++ b/platform/service/job_channel_test.go @@ -98,7 +98,7 @@ func TestCoreServiceRunJobClaimNoJob(t *testing.T) { } } -func TestCoreServiceRunJobClaimAllowsServerFileCapabilityWithoutDeclaration(t *testing.T) { +func TestCoreServiceRunJobClaimSkipsServerFileCapabilityWithoutDeclaration(t *testing.T) { svc := newTestCoreService() plugin, endpoint := createPluginAndRunEndpoint(t, svc) instance, err := svc.CreateServerInstance(domain.ServerInstance{ @@ -139,8 +139,12 @@ func TestCoreServiceRunJobClaimAllowsServerFileCapabilityWithoutDeclaration(t *t if err != nil { t.Fatalf("claim file list job: %v", err) } - if !claim.Accepted || !claim.HasJob || claim.Job.JobID != "job-file-list" || claim.Job.Capability != domain.JobCapabilityFilesList { - t.Fatalf("expected file job claim without files.list declaration, got %+v", claim) + if !claim.Accepted || claim.HasJob || claim.Job != nil || claim.NextPollSeconds <= 0 { + t.Fatalf("expected unsupported file job to remain queued, got %+v", claim) + } + jobs, err := svc.store.Jobs().List(domain.JobFilter{RunEndpointID: endpoint.ID}) + if err != nil || len(jobs) != 1 || jobs[0].State != domain.JobStateQueued { + t.Fatalf("expected unsupported file job to remain queued in storage, jobs=%+v err=%v", jobs, err) } }