Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/tests.e2e.existing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ function cleanup {
}
trap cleanup EXIT

# TMPNET_NETWORK_DIR needs to be unset to ensure --reuse-network won't target an existing network
unset TMPNET_NETWORK_DIR

print_separator
echo "starting initial test run that should create the reusable network"
./scripts/tests.e2e.sh --reuse-network --ginkgo.focus-file=xsvm.go "${@}"
Expand All @@ -37,7 +40,8 @@ INITIAL_NETWORK_DIR="$(realpath "${SYMLINK_PATH}")"

print_separator
echo "starting second test run that should reuse the network created by the first run"
./scripts/tests.e2e.sh --reuse-network --ginkgo.focus-file=xsvm.go "${@}"
echo "the network is first restarted to verify that the network state was correctly serialized"
./scripts/tests.e2e.sh --restart-network --ginkgo.focus-file=xsvm.go "${@}"

SUBSEQUENT_NETWORK_DIR="$(realpath "${SYMLINK_PATH}")"
echo "checking that the symlink path remains the same, indicating that the network was reused"
Expand Down
5 changes: 0 additions & 5 deletions tests/fixture/tmpnet/kube_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,6 @@ func (p *KubeRuntime) Restart(ctx context.Context) error {
return err
}

// Save node to disk to ensure the same state can be used to restart
if err := p.node.Write(); err != nil {
return err
}

statefulset, err := clientset.AppsV1().StatefulSets(namespace).Get(ctx, statefulSetName, metav1.GetOptions{})
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion tests/fixture/tmpnet/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ func (n *Network) Restart(ctx context.Context) error {
if err := restartNodes(ctx, nodes); err != nil {
return err
}
return WaitForHealthyNodes(ctx, n.log, n.Nodes)
return WaitForHealthyNodes(ctx, n.log, nodes)
Copy link
Contributor Author

@maru-ava maru-ava Jun 15, 2025

Choose a reason for hiding this comment

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

This was failing when n.Nodes included a stopped bootstrap test node

}

// Waits for the provided nodes to become healthy.
Expand Down
4 changes: 4 additions & 0 deletions tests/fixture/tmpnet/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ func (n *Node) WaitForStopped(ctx context.Context) error {
}

func (n *Node) Restart(ctx context.Context) error {
// Ensure the config used to restart the node is persisted for future use
if err := n.Write(); err != nil {
return err
}
return n.getRuntime().Restart(ctx)
}

Expand Down