@@ -58,27 +58,26 @@ class ErgoStateContextSpec extends HistoryTestHelpers {
58
58
fb.copy(extension = newExtension)
59
59
}
60
60
61
- // stress-test to trigger sporadic failure https://github.com/ergoplatform/ergo/issues/2114
62
- for (i <- 1 to 10000 ) {
63
- i == i // leave this, otherwise strange failures
61
+ // regression stress-test for sporadic failure https://github.com/ergoplatform/ergo/issues/2114
62
+ for (i <- 1 to 1000 ) {
64
63
65
64
// checks, specific for extension
66
65
// validation of field keys size
67
66
val imvKey = extensionKvGen(Extension .FieldKeySize - 1 , Extension .FieldValueMaxSize ).sample.get
68
67
sc.appendFullBlock(fbWithFields(imvKey +: oldFields)) shouldBe ' failure
69
68
70
69
// https://github.com/ergoplatform/ergo/issues/2114
71
- // this fails sporadically, but the mechanism of failure is different from the one further below
72
- // TODO: find cause, provide workaround/fix
73
- // disabling for now
74
- /*
70
+ // this fails sporadically, when `(imvValue._1.head == 0)`, because less value bytes will be generated
71
+ // by extensionKvGen(). Workaround is to just generate again while `(imvValue._1.head == 0)`
72
+ // TODO: document, and possibly rewrite extensionKvGen after the above issues are clarified/solved
73
+ // https://github.com/ergoplatform/ergo/issues/2118
74
+
75
75
// validation of field value sizes
76
76
var imvValue = extensionKvGen(Extension .FieldKeySize , Extension .FieldValueMaxSize + 1 ).sample.get
77
- while (imvValue._1.head == 1 ) {
77
+ while (imvValue._1.head == 0 ) {
78
78
imvValue = extensionKvGen(Extension .FieldKeySize , Extension .FieldValueMaxSize + 1 ).sample.get
79
79
}
80
80
sc.appendFullBlock(fbWithFields(imvValue +: oldFields)) shouldBe ' failure
81
- */
82
81
83
82
// validation of incorrect interlinks
84
83
val invalidInterlinks = nipopowAlgos.interlinksToExtension(
0 commit comments