(t *testing.T)
| 245 | } |
| 246 | |
| 247 | func TestMultiCollectionDCP(t *testing.T) { |
| 248 | base.TestRequiresCollections(t) |
| 249 | base.SkipImportTestsIfNotEnabled(t) |
| 250 | |
| 251 | const numCollections = 2 |
| 252 | |
| 253 | rt := NewRestTesterMultipleCollections(t, &RestTesterConfig{ |
| 254 | DatabaseConfig: &DatabaseConfig{DbConfig: DbConfig{AutoImport: true}}, |
| 255 | }, numCollections) |
| 256 | defer rt.Close() |
| 257 | |
| 258 | colls := rt.GetDbCollections() |
| 259 | require.Len(t, colls, numCollections) |
| 260 | |
| 261 | for _, c := range colls { |
| 262 | _, err := c.GetCollectionDatastore().Add(t.Name(), 0, map[string]any{"test": true}) |
| 263 | require.NoError(t, err) |
| 264 | } |
| 265 | |
| 266 | // ensure the docs are picked up by the import DCP feed and actually gets imported |
| 267 | err := rt.WaitForCondition(func() bool { |
| 268 | return rt.GetDatabase().DbStats.SharedBucketImport().ImportCount.Value() == numCollections |
| 269 | }) |
| 270 | require.NoError(t, err) |
| 271 | |
| 272 | rt.WaitForPendingChanges() |
| 273 | |
| 274 | for _, ks := range rt.GetKeyspaces() { |
| 275 | rt.WaitForChanges(1, fmt.Sprintf("/%s/_changes", ks), "", true) |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | func TestMultiCollectionChannelAccess(t *testing.T) { |
| 280 | base.TestRequiresCollections(t) |
nothing calls this directly
no test coverage detected