multi: run all test instances in parallel

This commit is contained in:
Olaoluwa Osuntokun committed 2017-06-17 01:00:07 +02:00
1 parent bb9bc9205a
commit 1be4d67ce4
30 files changed
+195 -1

No files matched your search

+8
View File
@@ -178,6 +178,8 @@ func createTestChannelState(cdb *DB) (*OpenChannel, error) {
}
func TestOpenChannelPutGetDelete(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -407,6 +409,8 @@ func TestOpenChannelPutGetDelete(t *testing.T) {
}
func TestChannelStateTransition(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -638,6 +642,8 @@ func TestChannelStateTransition(t *testing.T) {
}
func TestFetchPendingChannels(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
if err != nil {
t.Fatalf("uanble to make test database: %v", err)
@@ -717,6 +723,8 @@ func TestFetchPendingChannels(t *testing.T) {
}
func TestFetchClosedChannels(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
if err != nil {
t.Fatalf("unable to make test database: %v", err)
+2
View File
@@ -8,6 +8,8 @@ import (
)
func TestOpenWithCreate(t *testing.T) {
t.Parallel()
// First, create a temporary directory to be used for the duration of
// this test.
tempDirName, err := ioutil.TempDir("", "channeldb")
+14
View File
@@ -63,6 +63,8 @@ func createTestVertex(db *DB) (*LightningNode, error) {
}
func TestNodeInsertionAndDeletion(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -124,6 +126,8 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
}
func TestAliasLookup(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -168,6 +172,8 @@ func TestAliasLookup(t *testing.T) {
}
func TestSourceNode(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -207,6 +213,8 @@ func TestSourceNode(t *testing.T) {
}
func TestEdgeInsertionDeletion(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -332,6 +340,8 @@ func assertEdgeInfoEqual(t *testing.T, e1 *ChannelEdgeInfo,
}
func TestEdgeInfoUpdates(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -500,6 +510,8 @@ func randEdgePolicy(chanID uint64, op wire.OutPoint, db *DB) *ChannelEdgePolicy
}
func TestGraphTraversal(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -709,6 +721,8 @@ func assertChanViewEqual(t *testing.T, a []wire.OutPoint, b []*wire.OutPoint) {
}
func TestGraphPruning(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
+2
View File
@@ -32,6 +32,8 @@ func randInvoice(value btcutil.Amount) (*Invoice, error) {
}
func TestInvoiceWorkflow(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
+12
View File
@@ -12,6 +12,8 @@ import (
// and also initialization of meta data in case if don't have any in
// database.
func TestVersionFetchPut(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
@@ -46,6 +48,8 @@ func TestVersionFetchPut(t *testing.T) {
// TestOrderOfMigrations checks that migrations are applied in proper order.
func TestOrderOfMigrations(t *testing.T) {
t.Parallel()
appliedMigration := -1
versions := []version{
{0, nil},
@@ -88,6 +92,8 @@ func TestOrderOfMigrations(t *testing.T) {
// TestGlobalVersionList checks that there is no mistake in global version list
// in terms of version ordering.
func TestGlobalVersionList(t *testing.T) {
t.Parallel()
if dbVersions == nil {
t.Fatal("can't find versions list")
}
@@ -165,6 +171,8 @@ func applyMigration(t *testing.T, beforeMigration, afterMigration func(d *DB),
}
func TestMigrationWithPanic(t *testing.T) {
t.Parallel()
bucketPrefix := []byte("somebucket")
keyPrefix := []byte("someprefix")
beforeMigration := []byte("beforemigration")
@@ -234,6 +242,8 @@ func TestMigrationWithPanic(t *testing.T) {
}
func TestMigrationWithFatal(t *testing.T) {
t.Parallel()
bucketPrefix := []byte("somebucket")
keyPrefix := []byte("someprefix")
beforeMigration := []byte("beforemigration")
@@ -302,6 +312,8 @@ func TestMigrationWithFatal(t *testing.T) {
}
func TestMigrationWithoutErrors(t *testing.T) {
t.Parallel()
bucketPrefix := []byte("somebucket")
keyPrefix := []byte("someprefix")
beforeMigration := []byte("beforemigration")
+2
View File
@@ -12,6 +12,8 @@ import (
)
func TestLinkNodeEncodeDecode(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
if err != nil {
t.Fatalf("uanble to make test database: %v", err)
+4
View File
@@ -96,6 +96,8 @@ func makeRandomFakePayment() (*OutgoingPayment, error) {
}
func TestOutgoingPaymentSerialization(t *testing.T) {
t.Parallel()
fakePayment := makeFakePayment()
var b bytes.Buffer
@@ -118,6 +120,8 @@ func TestOutgoingPaymentSerialization(t *testing.T) {
}
func TestOutgoingPaymentWorkflow(t *testing.T) {
t.Parallel()
db, cleanUp, err := makeTestDB()
defer cleanUp()
if err != nil {
+2
View File
@@ -12,6 +12,8 @@ import (
// TestWaitingProofStore tests add/get/remove functions of the waiting proof
// storage.
func TestWaitingProofStore(t *testing.T) {
t.Parallel()
db, cleanup, err := makeTestDB()
if err != nil {