Add support for running hishtory redact while offline, even though this may lead to syncing inconsistency bugs

This commit is contained in:
David Dworken
2023-10-22 11:43:56 -07:00
parent c613e696b4
commit 2b1af986d8
3 changed files with 22 additions and 10 deletions

View File

@ -291,11 +291,11 @@ func TestAugmentedIsOfflineError(t *testing.T) {
ctx := hctx.MakeContext()
// By default, when the hishtory server is up, then IsOfflineError checks the error msg
require.True(t, isHishtoryServerUp(ctx))
require.True(t, CanReachHishtoryServer(ctx))
require.False(t, IsOfflineError(ctx, fmt.Errorf("unchecked error type")))
// When the hishtory server is down, then all error messages are treated as being due to offline errors
os.Setenv("HISHTORY_SIMULATE_NETWORK_ERROR", "1")
require.False(t, isHishtoryServerUp(ctx))
require.False(t, CanReachHishtoryServer(ctx))
require.True(t, IsOfflineError(ctx, fmt.Errorf("unchecked error type")))
}