Skip to content

chore: test shared inmem watch buffer - #13953

Open
smira wants to merge 1 commit into
siderolabs:mainfrom
smira:chore/test-shared-watcher
Open

chore: test shared inmem watch buffer#13953
smira wants to merge 1 commit into
siderolabs:mainfrom
smira:chore/test-shared-watcher

Conversation

@smira

@smira smira commented Aug 4, 2026

Copy link
Copy Markdown
Member

A testbed for the cosi-project/runtime#674

Copilot AI review requested due to automatic review settings August 4, 2026 18:35
@github-project-automation github-project-automation Bot moved this to To Do in Planning Aug 4, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Talos’ in-memory runtime state usage (primarily in tests) to use the newer inmem.NewState() API, aligning with a testbed for cosi-project/runtime#674 (shared inmem watch buffer). It also pins the runtime dependency to a fork via replace directives to exercise that behavior.

Changes:

  • Switch many tests from namespaced.NewState(inmem.Build) to inmem.NewState().
  • Update machined runtime/controller test scaffolding to initialize state with inmem.NewState().
  • Add replace github.com/cosi-project/runtime => github.com/smira/os-runtime ... (root + nested module) and refresh resulting go.sum entries (incl. gRPC/OpenTelemetry bumps in sums).

Reviewed changes

Copilot reviewed 52 out of 54 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/machinery/resources/v1alpha1/v1alpha1_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/time/time_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/storage/storage_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/siderolink/siderolink_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/security/security_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/secrets/secrets_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/runtime/runtime_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/runtime/condition_test.go Use inmem.NewState() in condition tests.
pkg/machinery/resources/perf/perf_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/network/network_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/network/condition_test.go Use inmem.NewState() in condition tests.
pkg/machinery/resources/kubespan/kubespan_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/kubeaccess/kubeaccess_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/k8s/k8s_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/hardware/hardware_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/files/files_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/files/condition_test.go Use inmem.NewState() in file-condition tests.
pkg/machinery/resources/etcd/etcd_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/cri/cri_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/config/config_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/cluster/cluster_test.go Use inmem.NewState() for resource registry tests.
pkg/machinery/resources/block/block_test.go Use inmem.NewState() in block resource and helper tests.
pkg/machinery/config/types/block/volume_config_test.go Use inmem.NewState() for runtime validation tests.
pkg/machinery/config/container/validate_test.go Use inmem.NewState() for runtime validation tests.
pkg/grpc/middleware/auth/unix/authorizer_test.go Use inmem.NewState() in authorizer tests.
internal/pkg/meta/meta_test.go Use inmem.NewState() in meta tests.
internal/app/trustd/internal/reg/reg_test.go Use inmem.NewState() in trustd registry tests.
internal/app/machined/pkg/system/volumes_test.go Use inmem.NewState() in system volume tests.
internal/app/machined/pkg/system/services/cri_test.go Use inmem.NewState() in CRI service tests.
internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_state.go Initialize v1alpha2 runtime state via inmem.NewState().
internal/app/machined/pkg/runtime/v1alpha1/platform/vmware/vmware_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/skip_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/opennebula_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/onegate_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/ipv6_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/hostname_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/dns_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/opennebula/aliases_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/nocloud_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/url_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/map_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/equinix_test.go Use inmem.NewState() in platform tests.
internal/app/machined/pkg/controllers/runtime/internal/diagnostics/address_overlap_test.go Use inmem.NewState() in controller diagnostics tests.
internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback_test.go Use inmem.NewState() in controller tests.
internal/app/machined/pkg/controllers/ctest/ctest.go Default controller test suite state now uses inmem.NewState().
internal/app/machined/pkg/controllers/block/volume_config_test.go Use inmem.NewState() in controller tests.
internal/app/machined/pkg/automaton/blockautomaton/volume_mount_test.go Use inmem.NewState() in automaton tests.
pkg/machinery/go.mod Add runtime replace in nested module; bump required gRPC version.
pkg/machinery/go.sum Update sums due to runtime fork and dependency graph changes.
go.mod Add repo-wide runtime replace to fork.
go.sum Update sums due to runtime fork and dependency graph changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod Outdated
Comment on lines +25 to +26
replace github.com/cosi-project/runtime => github.com/smira/os-runtime v0.0.0-20260804181026-d9d407093e3d

Comment thread pkg/machinery/go.mod Outdated
// forked ethtool introduces missing APIs
replace github.com/mdlayher/ethtool => github.com/siderolabs/ethtool v0.6.0-sidero

replace github.com/cosi-project/runtime => github.com/smira/os-runtime v0.0.0-20260804181026-d9d407093e3d
Comment on lines 50 to 54
ctx := context.TODO()

s.resources = state.WrapCore(namespaced.NewState(
func(ns string) state.CoreState {
return inmem.NewStateWithOptions(
inmem.WithHistoryInitialCapacity(8),
inmem.WithHistoryMaxCapacity(1024),
inmem.WithHistoryGap(4),
)(ns)
},
))
s.resources = state.WrapCore(inmem.NewState())
s.namespaceRegistry = registry.NewNamespaceRegistry(s.resources)
s.resourceRegistry = registry.NewResourceRegistry(s.resources)
Comment thread internal/app/machined/pkg/controllers/ctest/ctest.go
A testbed for the cosi-project/runtime#674

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira
smira force-pushed the chore/test-shared-watcher branch from bcc1d81 to c978a3c Compare August 5, 2026 11:22
@smira smira added the integration/qemu Run QEMU integration tests (all variants) label Aug 5, 2026
@smira smira moved this from In Review to In Progress in Planning Aug 11, 2026
@smira smira self-assigned this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration/qemu Run QEMU integration tests (all variants) status/ok-to-test

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants