Better test diag output on OOM (#42989)
If linearizability checking fails with OOM (or other exception), we did not get the serialized history written into the log, making it difficult to debug in cases where the problem is hard to reproduce. Fixed to always attempt dumping the serialized history. Related to #42244
This commit is contained in:
parent
79052050bf
commit
6a77dde5ea
|
@ -447,13 +447,17 @@ public class ConcurrentSeqNoVersioningIT extends AbstractDisruptionTestCase {
|
||||||
logger.info("--> Linearizability checking history of size: {} for key: {} and initialVersion: {}: {}", history.size(),
|
logger.info("--> Linearizability checking history of size: {} for key: {} and initialVersion: {}: {}", history.size(),
|
||||||
id, initialVersion, history);
|
id, initialVersion, history);
|
||||||
LinearizabilityChecker.SequentialSpec spec = new CASSequentialSpec(initialVersion);
|
LinearizabilityChecker.SequentialSpec spec = new CASSequentialSpec(initialVersion);
|
||||||
boolean linearizable = new LinearizabilityChecker().isLinearizable(spec, history, missingResponseGenerator());
|
boolean linearizable = false;
|
||||||
// implicitly test that we can serialize all histories.
|
try {
|
||||||
String serializedHistory = base64Serialize(history);
|
linearizable = new LinearizabilityChecker().isLinearizable(spec, history, missingResponseGenerator());
|
||||||
if (linearizable == false) {
|
} finally {
|
||||||
// we dump base64 encoded data, since the nature of this test is that it does not reproduce even with same seed.
|
// implicitly test that we can serialize all histories.
|
||||||
logger.error("Linearizability check failed. Spec: {}, initial version: {}, serialized history: {}", spec, initialVersion,
|
String serializedHistory = base64Serialize(history);
|
||||||
serializedHistory);
|
if (linearizable == false) {
|
||||||
|
// we dump base64 encoded data, since the nature of this test is that it does not reproduce even with same seed.
|
||||||
|
logger.error("Linearizability check failed. Spec: {}, initial version: {}, serialized history: {}",
|
||||||
|
spec, initialVersion, serializedHistory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return linearizable;
|
return linearizable;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue