Commit 6429953a authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

ut/blob: do not check for success on power failure UT



g_bserrno from blob deletion or snapshot creation,
should not be checked. It is implementation
dependent whether the error (or success) from those
calls actually means that enough data was persisted
on disk.
This test case should work even if we set the threshold
high enough that no failed opperations occur.

On the other hand some parts of those calls do cleanup
in them, meanwhile there is enough metadata data on disk already.
Such as cleaning up unused clusters or pages issue
writes, but at that point the blobs already are in expected
state.

Thus removed assert for g_bserrno, as failure is not indicative
of impossibility to recover.

While here, removed the spdk_bs_unload(). This UT are for
testing power fail safety. Never should it be the case that
enough writes occured in create/delete, but blobs are not
in the expected state.
When such bug would be introduced, it could be covered up
by spdk_bs_unload() cleanly closing up the blobstore.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic69c3061f2cc1fe04bf895632cdb11efb2fe6912
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/482660


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 78257ab6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -6484,10 +6484,10 @@ blob_delete_snapshot_power_failure(void)

		spdk_bs_delete_blob(bs, snapshotid, blob_op_complete, NULL);
		poll_threads();
		CU_ASSERT(g_bserrno != 0);

		spdk_bs_unload(g_bs, bs_op_complete, NULL);
		poll_threads();
		/* Do not shut down cleanly. Assumption is that after snapshot deletion
		 * reports success, changes to both blobs should already persisted. */
		_spdk_bs_free(bs);

		dev_reset_power_failure_event();

@@ -6594,11 +6594,11 @@ blob_create_snapshot_power_failure(void)
		/* Create snapshot */
		spdk_bs_create_snapshot(bs, blobid, NULL, blob_op_with_id_complete, NULL);
		poll_threads();
		CU_ASSERT(g_bserrno != 0);
		snapshotid = g_blobid;

		spdk_bs_unload(g_bs, bs_op_complete, NULL);
		poll_threads();
		/* Do not shut down cleanly. Assumption is that after create snapshot
		 * reports success, both blobs should be power-fail safe. */
		_spdk_bs_free(bs);

		dev_reset_power_failure_event();