| 84 | } |
| 85 | |
| 86 | func setupMultiNodeTestWithConfig(name string, configUpdater func(*config.Config)) (*service.LivekitServer, *service.LivekitServer, func()) { |
| 87 | logger.Infow("----------------STARTING TEST----------------", "test", name) |
| 88 | s1 := createMultiNodeServer(guid.New(nodeID1), defaultServerPort, configUpdater) |
| 89 | s2 := createMultiNodeServer(guid.New(nodeID2), secondServerPort, configUpdater) |
| 90 | go s1.Start() |
| 91 | go s2.Start() |
| 92 | |
| 93 | waitForServerToStart(s1) |
| 94 | waitForServerToStart(s2) |
| 95 | |
| 96 | return s1, s2, func() { |
| 97 | s1.Stop(true) |
| 98 | s2.Stop(true) |
| 99 | redisClient().FlushAll(context.Background()) |
| 100 | logger.Infow("----------------FINISHING TEST----------------", "test", name) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | func contextWithToken(token string) context.Context { |
| 105 | header := make(http.Header) |