@@ -25,6 +25,14 @@ import (
2525var _ = ginkgo .Describe ("[DevWorkspace Debug Start Mode]" , func () {
2626 defer ginkgo .GinkgoRecover ()
2727
28+ const workspaceName = "code-latest-with-debug-start"
29+
30+ ginkgo .AfterEach (func () {
31+ // Clean up workspace and wait for PVC to be fully deleted
32+ // This prevents PVC conflicts in subsequent tests, especially in CI environments
33+ _ = config .DevK8sClient .DeleteDevWorkspaceAndWait (workspaceName , config .DevWorkspaceNamespace )
34+ })
35+
2836 ginkgo .It ("Wait DevWorkspace Webhook Server Pod" , func () {
2937 controllerLabel := "app.kubernetes.io/name=devworkspace-webhook-server"
3038
@@ -39,21 +47,21 @@ var _ = ginkgo.Describe("[DevWorkspace Debug Start Mode]", func() {
3947 }
4048 })
4149
42- ginkgo .It ("Add Debug DevWorkspace to cluster and wait starting status" , func () {
50+ ginkgo .It ("Add Debug DevWorkspace to cluster and wait running status" , func () {
4351 commandResult , err := config .DevK8sClient .OcApplyWorkspace (config .DevWorkspaceNamespace , "test/resources/simple-devworkspace-debug-start-annotation.yaml" )
4452 if err != nil {
4553 ginkgo .Fail (fmt .Sprintf ("Failed to create DevWorkspace: %s %s" , err .Error (), commandResult ))
4654 return
4755 }
4856
49- deploy , err := config .DevK8sClient .WaitDevWsStatus ("code-latest-with-debug-start" , config .DevWorkspaceNamespace , dw .DevWorkspaceStatusStarting )
57+ deploy , err := config .DevK8sClient .WaitDevWsStatus (workspaceName , config .DevWorkspaceNamespace , dw .DevWorkspaceStatusRunning )
5058 if ! deploy {
5159 ginkgo .Fail (fmt .Sprintf ("DevWorkspace didn't start properly. Error: %s" , err ))
5260 }
5361 })
5462
5563 ginkgo .It ("Check DevWorkspace Conditions for Debug Start message" , func () {
56- devWorkspaceStatus , err := config .DevK8sClient .GetDevWsStatus ("code-latest-with-debug-start" , config .DevWorkspaceNamespace )
64+ devWorkspaceStatus , err := config .DevK8sClient .GetDevWsStatus (workspaceName , config .DevWorkspaceNamespace )
5765 if err != nil {
5866 ginkgo .Fail (fmt .Sprintf ("Failure in fetching DevWorkspace status. Error: %s" , err ))
5967 }
0 commit comments