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

+16 -1
View File
@@ -355,6 +355,8 @@ func calcStaticFee(numHTLCs int) btcutil.Amount {
// * DSL language perhaps?
// * constructed via input/output files
func TestSimpleAddSettleWorkflow(t *testing.T) {
t.Parallel()
// Create a test channel which will be used for the duration of this
// unittest. The channel will be funded evenly with Alice having 5 BTC,
// and Bob having 5 BTC.
@@ -604,6 +606,8 @@ func TestSimpleAddSettleWorkflow(t *testing.T) {
// TestCheckCommitTxSize checks that estimation size of commitment
// transaction with some degree of error corresponds to the actual size.
func TestCheckCommitTxSize(t *testing.T) {
t.Parallel()
checkSize := func(channel *LightningChannel, count int) {
// Due to variable size of the signatures (70-73) in
// witness script actual size of commitment transaction might
@@ -695,6 +699,8 @@ func TestCheckCommitTxSize(t *testing.T) {
}
func TestCooperativeChannelClosure(t *testing.T) {
t.Parallel()
// Create a test channel which will be used for the duration of this
// unittest. The channel will be funded evenly with Alice having 5 BTC,
// and Bob having 5 BTC.
@@ -743,8 +749,9 @@ func TestCooperativeChannelClosure(t *testing.T) {
// TestForceClose checks that the resulting ForceCloseSummary is correct when
// a peer is ForceClosing the channel. Will check outputs both above and below
// the dust limit.
// TODO(cjamthagen): Check HTLCs when implemented.
func TestForceClose(t *testing.T) {
t.Parallel()
createHTLC := func(data, amount btcutil.Amount) (*lnwire.UpdateAddHTLC,
[32]byte) {
preimage := bytes.Repeat([]byte{byte(data)}, 32)
@@ -929,6 +936,8 @@ func TestForceClose(t *testing.T) {
// commitment transaction as output, but sender balance is decreased (thereby all
// unsettled dust HTLCs will go to miners fee).
func TestCheckDustLimit(t *testing.T) {
t.Parallel()
createHTLC := func(data, amount btcutil.Amount) (*lnwire.UpdateAddHTLC,
[32]byte) {
preimage := bytes.Repeat([]byte{byte(data)}, 32)
@@ -1075,6 +1084,8 @@ func TestCheckDustLimit(t *testing.T) {
}
func TestStateUpdatePersistence(t *testing.T) {
t.Parallel()
// Create a test channel which will be used for the duration of this
// unittest. The channel will be funded evenly with Alice having 5 BTC,
// and Bob having 5 BTC.
@@ -1339,6 +1350,8 @@ func TestStateUpdatePersistence(t *testing.T) {
}
func TestCancelHTLC(t *testing.T) {
t.Parallel()
// Create a test channel which will be used for the duration of this
// unittest. The channel will be funded evenly with Alice having 5 BTC,
// and Bob having 5 BTC.
@@ -1437,6 +1450,8 @@ func TestCancelHTLC(t *testing.T) {
}
func TestCooperativeCloseDustAdherence(t *testing.T) {
t.Parallel()
// Create a test channel which will be used for the duration of this
// unittest. The channel will be funded evenly with Alice having 5 BTC,
// and Bob having 5 BTC.
+2
View File
@@ -1271,6 +1271,8 @@ func clearWalletState(w *lnwallet.LightningWallet) error {
//
// TODO(roasbeef): purge bobNode in favor of dual lnwallet's
func TestLightningWallet(t *testing.T) {
t.Parallel()
netParams := &chaincfg.SimNetParams
// Initialize the harness around a btcd node which will serve as our
+9
View File
@@ -23,6 +23,8 @@ import (
// * Bob's spend from his unencumbered output within Alice's commitment
// transaction.
func TestCommitmentSpendValidation(t *testing.T) {
t.Parallel()
// We generate a fake output, and the corresponding txin. This output
// doesn't need to exist, as we'll only be validating spending from the
// transaction that references this.
@@ -181,6 +183,8 @@ func TestCommitmentSpendValidation(t *testing.T) {
// hash, the homomorphic revocation public and private key derivation work
// properly.
func TestRevocationKeyDerivation(t *testing.T) {
t.Parallel()
revocationPreimage := testHdSeed[:]
priv, pub := btcec.PrivKeyFromBytes(btcec.S256(), testWalletPrivKey)
@@ -232,6 +236,8 @@ func makeWitnessTestCase(t *testing.T, f func() (wire.TxWitness, error)) func()
// * invalid sequence for CSV
// * valid lock-time+sequence, valid sig
func TestHTLCSenderSpendValidation(t *testing.T) {
t.Parallel()
// TODO(roasbeef): eliminate duplication with other HTLC tests.
// We generate a fake output, and the coresponding txin. This output
@@ -406,6 +412,8 @@ func TestHTLCSenderSpendValidation(t *testing.T) {
// * refund w/ invalid lock time
// * refund w/ valid lock time
func TestHTLCReceiverSpendValidation(t *testing.T) {
t.Parallel()
// We generate a fake output, and the coresponding txin. This output
// doesn't need to exist, as we'll only be validating spending from the
// transaction that references this.
@@ -601,6 +609,7 @@ var stateHintTests = []struct {
}
func TestCommitTxStateHint(t *testing.T) {
t.Parallel()
var obsfucator [StateHintSize]byte
copy(obsfucator[:], testHdSeed[:StateHintSize])