The problem was that after the restart of the cluster, when we first fetch the account, the account gets created and sometimes synced (since created accounts are unclean and need to be synced).
Whenever it got synced before the check the test failed.
While debugging I noticed that the GET route for fetching accounts only returns the account id which I thought was odd anyway so I updated it to return the full account. So the route returns the freshly created, unclean account right away without a chance to sync it. Which fixes the NDF.
Test ran 6*50 times without failing with this fix.
NDF that was fixed:
cluster_test.go:1386: account shouldn't be marked as clean shutdown or not require a sync, got true false
Example: https://github.com/SiaFoundation/renterd/actions/runs/11496423699/job/31998008008
The problem was that after the restart of the cluster, when we first fetch the account, the account gets created and sometimes synced (since created accounts are unclean and need to be synced). Whenever it got synced before the check the test failed.
While debugging I noticed that the GET route for fetching accounts only returns the account id which I thought was odd anyway so I updated it to return the full account. So the route returns the freshly created, unclean account right away without a chance to sync it. Which fixes the NDF.