You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: manager_test.go
    path of file: ./repos/rudder-server/warehouse/multitenant
    
    the code of the file until where you have to start completion: package multitenant_test

import (
	"context"
	"testing"

	"github.com/rudderlabs/rudder-go-kit/config"

	"github.com/stretchr/testify/require"
	"golang.org/x/sync/errgroup"

	backendconfig "github.com/rudderlabs/rudder-server/backend-config"
	"github.com/rudderlabs/rudder-server/services/controlplane/identity"
	"github.com/rudderlabs/rudder-server/utils/pubsub"
	"github.com/rudderlabs/rudder-server/warehouse/multitenant"
)

var _ backendconfig.BackendConfig = (*mockBackendConfig)(nil)

type mockBackendConfig struct {
	config map[string]backendconfig.ConfigT
}

func (*mockBackendConfig) WaitForConfig(_ context.Context)          {}
func (*mockBackendConfig) Stop()                                    {}
func (*mockBackendConfig) StartWithIDs(_ context.Conte
    
func TestDegradeWorkspace(t *testing.T) {
	testcase := []struct {
		name                string
		namespaceWorkspaces []string
		degradedWorkspaces  []string
		expectedWorkspaces  []string
	}{
		{
			name:                "no degraded workspaces",
			namespaceWorkspaces: []string{"workspace1", "workspace2"},
			degradedWorkspaces:  []string{},
			expectedWorkspaces:  []string{"workspace1", "workspace2"},
		},
		{
			name:                "one degraded workspace",
			namespaceWorkspaces: []string{"workspace1", "workspace2"},
			degradedWorkspaces:  []string{"workspace1"},
			expectedWorkspaces:  []string{"workspace2"},
		},
		{
			name:                "multiple degraded workspaces",
			namespaceWorkspaces: []string{"workspace1", "workspace2", "workspace3"},
			degradedWorkspaces:  []string{"workspace1", "workspace3"},
			expectedWorkspaces:  []string{"workspace2"},
		},
		{
			name:                "all workspaces degraded",
			namespaceWorkspaces: []string{"workspace1", "workspace2"},
			degradedWorkspaces:  []string{"workspace1", "workspace2"},
			expectedWorkspaces:  []string{},
		},
	}

	for _, tc := range testcase {
		t.Run(tc.name, func(t *testing.T) {
			backendConfig := make(map[string]backendconfig.ConfigT)
			expectedConfig := make(map[string]backendconfig.ConfigT)

			for _, workspace := range tc.namespaceWorkspaces {
				backendConfig[workspace] = backendconfig.ConfigT{
					WorkspaceID: workspace,
				}
			}

			for _, workspace := range tc.expectedWorkspaces {
				expectedConfig[workspace] = backendconfig.ConfigT{
					WorkspaceID: workspace,
				}
			}

			c := config.New()
			c.Set("Warehouse.degradedWorkspaceIDs", tc.degradedWorkspaces)

			m := multitenant.New(c, &mockBackendConfig{
				config: backendConfig,
			})

			ctx, cancel := context.WithCancel(context.Background())
			defer cancel()

			ch := m.WatchConfig(ctx)
			config := <-ch

			require.Equal(t, expectedConfig, config, "filter configuration by degraded workspaces")

			require.Equal(t, tc.degradedWorkspaces, m.DegradedWorkspaces())

			for _, workspace := range tc.degradedWorkspaces {
				require.True(t, m.DegradedWorkspace(workspace))
			}
		})
	}
}