Skip to content

TestSingleSectorStorageObligationStack ndf fix

Matthew Sevey requested to merge ndf-fixes into master

BUG FIX

Description of Bug and Fix

TestSingleSectorStorageObligationStack was failing for

--- FAIL: TestSingleSectorStorageObligationStack (13.81s)
	storageobligations_smoke_test.go:345: storage obligation is not saying that the storage proof was confirmed on the blockchain

This would only happen online, I ran this test in a loop locally and it passed over 100 times in a row but online it would fail immediately quite consistently.

What I found was that the storage obligation that was being checked within the build.Retry was never changing. This meant locally it was correct the first time you check every time but online it was wrong the first time you checked and then the value never changed.

Upon further investigation it was discovered that Flush() was getting called prior to the needed thread group being added that confirmed the storage proof. This means the test code was running ahead of the code it was trying to test. To fix this, a sleep was added prior to Flush() to ensure that the needed thread group is added and therefore Flush() is blocking as intended. Additionally the blocks mined was reduced by one as it was discovered that the test was mining 1 block past when the storage proof confirmation was being triggered.

Testing Added

N/A

Proof of Fix (ie Screenshot if applicable)

https://gitlab.com/NebulousLabs/Sia/-/jobs/112369014

Changes to Work Flow (if applicable)

N/A

Edited by Matthew Sevey

Merge request reports