Skip to content
Open
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
2 changes: 1 addition & 1 deletion e2e/scenario_gpu_daemonset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// This is the "upstream" deployment model commonly used by customers who manage their own
// NVIDIA device plugin deployment.
func Test_Ubuntu2204_NvidiaDevicePlugin_Daemonset(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: "Tests that NVIDIA device plugin works when deployed as a DaemonSet (not systemd service)",
Tags: Tags{
GPU: true,
Expand Down
12 changes: 6 additions & 6 deletions e2e/scenario_gpu_managed_experience_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func Test_DCGM_Exporter_Compatibility(t *testing.T) {
for _, tc := range testCases {
tc := tc // capture range variable for parallel execution
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

This comment is now misleading: the subtests are not marked t.Parallel() and the scenario runner used is RunScenarioSequential, so this test is no longer set up for parallel execution. Update/remove the comment (and the tc := tc note) to match the intended sequential behavior, or add t.Parallel() if parallel subtests are still desired.

Suggested change
tc := tc // capture range variable for parallel execution
tc := tc // capture range variable for use in this subtest

Copilot uses AI. Check for mistakes.
t.Run(tc.name, func(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: tc.description,
Tags: Tags{
GPU: true,
Expand Down Expand Up @@ -239,7 +239,7 @@ func Test_DCGM_Exporter_Compatibility(t *testing.T) {
}

func Test_Ubuntu2404_NvidiaDevicePluginRunning(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: "Tests that NVIDIA device plugin and DCGM Exporter are running & functional on Ubuntu 24.04 GPU nodes",
Tags: Tags{
GPU: true,
Expand Down Expand Up @@ -314,7 +314,7 @@ func Test_Ubuntu2404_NvidiaDevicePluginRunning(t *testing.T) {
}

func Test_Ubuntu2204_NvidiaDevicePluginRunning(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: "Tests that NVIDIA device plugin and DCGM Exporter are running & functional on Ubuntu 22.04 GPU nodes",
Tags: Tags{
GPU: true,
Expand Down Expand Up @@ -388,7 +388,7 @@ func Test_Ubuntu2204_NvidiaDevicePluginRunning(t *testing.T) {
}

func Test_AzureLinux3_NvidiaDevicePluginRunning(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: "Tests that NVIDIA device plugin and DCGM Exporter are running & functional on Azure Linux v3 GPU nodes",
Tags: Tags{
GPU: true,
Expand Down Expand Up @@ -459,7 +459,7 @@ func Test_AzureLinux3_NvidiaDevicePluginRunning(t *testing.T) {
}

func Test_Ubuntu2404_NvidiaDevicePluginRunning_MIG(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: "Tests that NVIDIA device plugin and DCGM Exporter work with MIG enabled on Ubuntu 24.04 GPU nodes",
Tags: Tags{
GPU: true,
Expand Down Expand Up @@ -536,7 +536,7 @@ func Test_Ubuntu2404_NvidiaDevicePluginRunning_MIG(t *testing.T) {
}

func Test_Ubuntu2204_NvidiaDevicePluginRunning_WithoutVMSSTag(t *testing.T) {
RunScenario(t, &Scenario{
RunScenarioSequential(t, &Scenario{
Description: "Tests that NVIDIA device plugin and DCGM Exporter work via NBC EnableManagedGPU field without VMSS tag",
Tags: Tags{
GPU: true,
Expand Down
5 changes: 5 additions & 0 deletions e2e/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ func RunScenario(t *testing.T, s *Scenario) error {
return runScenario(t, s)
}

func RunScenarioSequential(t *testing.T, s *Scenario) error {
// Default path
return runScenario(t, s)
}
Comment on lines +89 to +92
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

RunScenarioSequential diverges from RunScenario semantics: it bypasses the config.Config.TestPreProvision || s.VHDCaching branch, so running GPU scenarios under TEST_PRE_PROVISION or with VHDCaching enabled will no longer execute the two-stage pre-provision/VHD-capture flow. Consider refactoring RunScenario into a shared helper (e.g., runScenarioWithOptions(parallel bool)) so the only behavioral difference is omitting t.Parallel() (and also omitting the inner t.Parallel() calls in the pre-provision subtests when running sequentially).

Copilot uses AI. Check for mistakes.
Comment on lines +89 to +92
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The name RunScenarioSequential suggests it will always run scenarios sequentially, but it only avoids calling t.Parallel(); if a caller wraps it in a t.Run(...); t.Parallel() subtest, scenarios will still execute concurrently. Consider renaming to something like RunScenarioNonParallel (or similar) and/or adding a short doc comment clarifying the concurrency guarantee.

Copilot uses AI. Check for mistakes.

func runScenarioWithPreProvision(t *testing.T, original *Scenario) {
// This is hard to understand. Some functional magic is used to run the original scenario in two stages.
// 1. Stage 1: Run the original scenario with pre-provisioning enabled, but skip the main validation and validate only pre-provisioning.
Expand Down
Loading