You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// postProcessAnalyses is used to update different analyses based on the information gleaned from looking at all the analyses together instead of individual data.
// TestGetReplicationAnalysis tests the entire GetReplicationAnalysis. It inserts data into the database and runs the function.
997
998
// The database is not faked. This is intended to give more test coverage. This test is more comprehensive but more expensive than TestGetReplicationAnalysisDecision.
999
+
=======
1000
+
// TestStalePrimary tests that an old primary that remains writable and is of tablet type PRIMARY
1001
+
// in the topo is demoted to a read-only replica by VTOrc.
require.NoError(t, err, "expected detection analysis to run without error")
1093
+
require.Len(t, got, 1, "expected exactly one analysis entry for the shard")
1094
+
require.Equal(t, AnalysisCode("StaleTopoPrimary"), got[0].Analysis, "expected stale primary analysis")
1095
+
require.Equal(t, "ks", got[0].AnalyzedKeyspace, "expected analysis to target keyspace ks")
1096
+
require.Equal(t, "0", got[0].AnalyzedShard, "expected analysis to target shard 0")
1097
+
}
1098
+
}
1099
+
1100
+
// TestGetDetectionAnalysis tests the entire GetDetectionAnalysis. It inserts data into the database and runs the function.
1101
+
// The database is not faked. This is intended to give more test coverage. This test is more comprehensive but more expensive than TestGetDetectionAnalysisDecision.
// This test is somewhere between a unit test, and an end-to-end test. It is specifically useful for testing situations which are hard to come by in end-to-end test, but require
0 commit comments