Skip to content

Commit 0db5a58

Browse files
committed
tapgraden: simplify unit test logic in an attempt to fix flake
Attempting to fix flake: ``` --- FAIL: TestBatchedAssetIssuance (88.29s) --- FAIL: TestBatchedAssetIssuance/minting_with_cancellation test_sqlite.go:11: Creating new SQLite DB handle for testing: /tmp/TestBatchedAssetIssuanceminting_with_cancellation948128507/ 001/tmp.db planter_test.go:365: Batch seedling mismatch: ```
1 parent 6d5c28d commit 0db5a58

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tapgarden/planter_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,10 +1336,9 @@ func testMintingCancelFinalize(t *mintingTestHarness) {
13361336
// harness.
13371337
t.refreshChainPlanter()
13381338

1339-
// Create an initial batch of 5 seedlings.
1340-
const numSeedlings = 5
1339+
// Create an initial set of seedlings.
1340+
const numSeedlings = 4
13411341
seedlings := t.queueInitialBatch(numSeedlings)
1342-
firstSeedling := seedlings[0]
13431342

13441343
// If we cancel the current batch, the pending batch should be cleared,
13451344
// but the seedlings should still exist on disk.
@@ -1353,9 +1352,8 @@ func testMintingCancelFinalize(t *mintingTestHarness) {
13531352
t.finalizeBatchAssertFrozen(true)
13541353
t.cancelMintingBatch(true)
13551354

1356-
// Next, make another 5 random seedlings and continue with minting.
1355+
// Next, make another set of random seedlings and continue with minting.
13571356
seedlings = t.newRandSeedlings(numSeedlings)
1358-
seedlings[0] = firstSeedling
13591357
seedlings[0].ScriptKey = asset.ScriptKey{}
13601358
if seedlings[0].EnableEmission {
13611359
seedlings[0].GroupInternalKey = nil
@@ -1367,7 +1365,7 @@ func testMintingCancelFinalize(t *mintingTestHarness) {
13671365

13681366
// If we attempt to queue a seedling with the same name as a pending
13691367
// seedling, the planter should reject it.
1370-
updates, err := t.planter.QueueNewSeedling(firstSeedling)
1368+
updates, err := t.planter.QueueNewSeedling(seedlings[0])
13711369
require.NoError(t, err)
13721370
planterErr := <-updates
13731371
require.NotNil(t, planterErr.Error)

0 commit comments

Comments
 (0)