Skip to content

Fix TestDirectories NDF

Matthew Sevey requested to merge test-dir-ndf into unstable

Test NDF Fix

Passing Pipeline

The following pipelines both ran the test 20 times.

  1. https://gitlab.com/NebulousLabs/Sia/-/jobs/158099976
  2. https://gitlab.com/NebulousLabs/Sia/-/jobs/158106338

Original Error Message / Reason for NDF

--- FAIL: TestRenter/TestDirectories (0.11s)
    renter_test.go:516: [failed to upload directory; failed to create directory: a siadir already exists at that location]

--- FAIL: TestRenter/TestDirectories (1.20s)
    renter_test.go:593: Expected IsNotExist err, but got err: <nil>

Description of Solution

This was a two part NDF. Both I believe were impacted by the background bubble thread. The bubble thread checks for siadir metadata files and creates them if they do not exists. This is done because there is at least one place where a siadir can be created without the metadata file. The second error I believe is from the bubble thread recreating a metadata file for a deleted siadir. I updated this decision to avoid this edge case. For the first error I believe the bubble thread is a contributor but also I believe the UploadNewDirectory testnode method was doing some additional functions that were unnecessary. I cleaned up the creation and upload of a new directory to address the first bug.

Edited by Matthew Sevey

Merge request reports