MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / WaitForDatabaseState

Method WaitForDatabaseState

rest/utilities_testing.go:1073–1077  ·  view source on GitHub ↗

WaitForDatabaseState waits for the specified database to be in the specified state. Fails the test harness if the state is not reached within the timeout.

(dbName string, targetState string)

Source from the content-addressed store, hash-verified

1071
1072// WaitForDatabaseState waits for the specified database to be in the specified state. Fails the test harness if the state is not reached within the timeout.
1073func (rt *RestTester) WaitForDatabaseState(dbName string, targetState string) {
1074 require.EventuallyWithT(rt.TB(), func(c *assert.CollectT) {
1075 assert.Equal(c, targetState, rt.GetDatabaseRoot(dbName).State)
1076 }, 10*time.Second, 100*time.Millisecond)
1077}
1078
1079func (rt *RestTester) SendAdminRequestWithHeaders(method, resource string, body string, headers map[string]string) *TestResponse {
1080 request := Request(method, rt.mustTemplateResource(resource), body)

Callers 2

WaitForDBStateMethod · 0.95
TestRequireResyncFunction · 0.80

Calls 3

TBMethod · 0.95
GetDatabaseRootMethod · 0.95
EqualMethod · 0.45

Tested by 1

TestRequireResyncFunction · 0.64