hunk.code_window:         commands,
           {
               killOthers: 'failure',
           },
       );
       await result;
   }
  
hunk.labels: keep keep keep keep keep replace keep keep
hunk.after_edit:     let exitCode = 0;
       try {
           await result;
       } catch (closeEvents) {
           exitCode = getExitCode(closeEvents, 0);
       }
       return exitCode;
  
hunk.file_path: webapp/scripts/dev-server.js
hunk.type: replace
file: // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
  // See LICENSE.txt for license information.
  
  package app
  
  import (
  	"testing"
  
  	"github.com/stretchr/testify/require"
  
  	"github.com/mattermost/mattermost/server/v8/channels/app/platform"
  	"github.com/mattermost/mattermost/server/v8/channels/product"
  	"github.com/mattermost/mattermost/server/v8/config"
  )
  
  const (
  	testSrvKey1 = "test_1"
  	testSrvKey2 = "test_2"
  )
  
  type productA struct{}
  
  func newProductA(m map[product.ServiceKey]any) (product.Product, error) {
  	m[testSrvKey1] = nil
  	return &productA{}, nil
  }
  
  func (p *productA) Start() error { return nil }
  func (p *productA) Stop() error  { return nil }
  
  type productB struct{}
  
  func newProductB(m map[product.ServiceKey]any) (product.Product, error) {
  	m[testSrvKey2] = nil
  	return &productB{}, nil
  }
  
  func (p *productB) Start() error { return nil }
  func (p *productB) Stop() error  { return nil }
  
  func TestInitializeProducts(t *testing.T) {
  	configStore := config.NewTestMemoryStore()
  	memoryConfig := configStore.Get()
  	memoryConfig.SqlSettings = *mainHelper.GetSQLSettings()
  	configStore.Set(memoryConfig)
  
  	ps, err := platform.New(platform.ServiceConfig{ConfigStore: configStore})
  	require.NoError(t, err)
  	defer ps.Shutdown()
  
  	t.Run("2 products and no circular dependency", func(t *testing.T) {
  		serviceMap := map[product.ServiceKey]any{
  			product.ConfigKey:          nil,
  			product.LicenseKey:         nil,
  			product.FilestoreKey:       nil,
  			product.ExportFilestoreKey: nil,
  			product.ClusterKey:         nil,
  		}
  
  		products := map[string]product.Manifest{
  			"productA": {
  				Initializer: newProductA,
  				Dependencies: map[product.ServiceKey]struct{}{
  					product.ConfigKey:          {},
  					product.LicenseKey:         {},
  					product.FilestoreKey:       {},
  					product.ExportFilestoreKey: {},
  					product.ClusterKey:         {},
  				},
  			},
  			"productB": {
  				Initializer: newProductB,
  				Dependencies: map[product.ServiceKey]struct{}{
  					product.ConfigKey:          {},
  					testSrvKey1:                {},
  					product.FilestoreKey:       {},
  					product.ExportFilestoreKey: {},
  					product.ClusterKey:         {},
  				},
  			},
  		}
  
  		server := &Server{
  			products: make(map[string]product.Product),
  			platform: ps,
  		}
  
  		err = server.initializeProducts(products, serviceMap)
  		require.NoError(t, err)
  		require.Len(t, server.products, 2)
  	})
  
  	t.Run("2 products and circular dependency", func(t *testing.T) {
  		serviceMap := map[product.ServiceKey]any{
  			product.ConfigKey:          nil,
  			product.LicenseKey:         nil,
  			product.FilestoreKey:       nil,
  			product.ExportFilestoreKey: nil,
  			product.ClusterKey:         nil,
  		}
  
  		products := map[string]product.Manifest{
  			"productA": {
  				Initializer: newProductA,
  				Dependencies: map[product.ServiceKey]struct{}{
  					product.ConfigKey:          {},
  					product.LicenseKey:         {},
  					product.FilestoreKey:       {},
  					product.ExportFilestoreKey: {},
  					product.ClusterKey:         {},
  					testSrvKey2:                {},
  				},
  			},
  			"productB": {
  				Initializer: newProductB,
  				Dependencies: map[product.ServiceKey]struct{}{
  					product.ConfigKey:          {},
  					testSrvKey1:                {},
  					product.FilestoreKey:       {},
  					product.ExportFilestoreKey: {},
  					product.ClusterKey:         {},
  				},
  			},
  		}
  		server := &Server{
  			products: make(map[string]product.Product),
  			platform: ps,
  		}
  
  		err := server.initializeProducts(products, serviceMap)
  		require.Error(t, err)
  	})
  
  	t.Run("2 products and one w/o any dependency", func(t *testing.T) {
  		serviceMap := map[product.ServiceKey]any{
  			product.ConfigKey:          nil,
  			product.LicenseKey:         nil,
  			product.FilestoreKey:       nil,
  			product.ExportFilestoreKey: nil,
  			product.ClusterKey:         nil,
  		}
  
  		products := map[string]product.Manifest{
  			"productA": {
  				Initializer: newProductA,
  				Dependencies: map[product.ServiceKey]struct{}{
  					product.ConfigKey:  {},
  					product.LicenseKey: {},
  				},
  			},
  			"productB": {
  				Initializer: newProductB,
  			},
  		}
  		server := &Server{
  			products: make(map[string]product.Product),
  			platform: ps,
  		}
  
  		err := server.initializeProducts(products, serviceMap)
  		require.NoError(t, err)
  		require.Len(t, server.products, 2)
  	})
  }
  