Regression test for https://github.com/couchbase/sync_gateway/issues/2847
(t *testing.T)
| 937 | |
| 938 | // Regression test for https://github.com/couchbase/sync_gateway/issues/2847 |
| 939 | func TestRevsHistoryInfiniteLoop(t *testing.T) { |
| 940 | |
| 941 | docId := "testdocProblematicRevTree" |
| 942 | |
| 943 | rawDoc, err := unmarshalDocument(docId, []byte(testdocProblematicRevTree1)) |
| 944 | if err != nil { |
| 945 | t.Fatalf("Error unmarshalling doc: %v", err) |
| 946 | } |
| 947 | |
| 948 | revId := "275-6458b32429e335f981fc12b73765833d" |
| 949 | _, err = getHistoryWithTimeout( |
| 950 | rawDoc, |
| 951 | revId, |
| 952 | time.Second*1, |
| 953 | ) |
| 954 | |
| 955 | // This should return an error, since the history has cycles |
| 956 | assert.True(t, err != nil) |
| 957 | |
| 958 | // The error should *not* be a timeout error |
| 959 | assert.False(t, strings.Contains(err.Error(), "Timeout")) |
| 960 | |
| 961 | } |
| 962 | |
| 963 | // Repair tool for https://github.com/couchbase/sync_gateway/issues/2847 |
| 964 | func TestRepairRevsHistoryWithCycles(t *testing.T) { |
nothing calls this directly
no test coverage detected