add a heartbeat's worth of delay before restoring mutated globals
the race detector cries on travis
This commit is contained in:
parent
6d24f46a13
commit
6a230e711e
|
@ -321,6 +321,7 @@ func TestGossipsubAttackGRAFTDuringBackoff(t *testing.T) {
|
|||
originalGossipSubPruneBackoffPenalty := GossipSubPruneBackoffPenalty
|
||||
GossipSubPruneBackoffPenalty = 500 * time.Millisecond
|
||||
defer func() {
|
||||
time.Sleep(time.Second)
|
||||
GossipSubPruneBackoff = originalGossipSubPruneBackoff
|
||||
GossipSubPruneBackoffPenalty = originalGossipSubPruneBackoffPenalty
|
||||
GossipSubGraftFloodThreshold = originalGossipSubGraftFloodThreshold
|
||||
|
|
|
@ -271,7 +271,10 @@ func TestGossipsubFanoutMaintenance(t *testing.T) {
|
|||
|
||||
func TestGossipsubFanoutExpiry(t *testing.T) {
|
||||
GossipSubFanoutTTL = 1 * time.Second
|
||||
defer func() { GossipSubFanoutTTL = 60 * time.Second }()
|
||||
defer func() {
|
||||
time.Sleep(time.Second)
|
||||
GossipSubFanoutTTL = 60 * time.Second
|
||||
}()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
@ -997,6 +1000,7 @@ func TestGossipsubDirectPeers(t *testing.T) {
|
|||
originalGossipSubDirectConnectTicks := GossipSubDirectConnectTicks
|
||||
GossipSubDirectConnectTicks = 2
|
||||
defer func() {
|
||||
time.Sleep(time.Second)
|
||||
GossipSubDirectConnectTicks = originalGossipSubDirectConnectTicks
|
||||
}()
|
||||
|
||||
|
@ -1282,6 +1286,7 @@ func TestGossipsubOpportunisticGrafting(t *testing.T) {
|
|||
originalGossipSubOpportunisticGraftTicks := GossipSubOpportunisticGraftTicks
|
||||
GossipSubOpportunisticGraftTicks = 2
|
||||
defer func() {
|
||||
time.Sleep(time.Second)
|
||||
GossipSubPruneBackoff = originalGossipSubPruneBackoff
|
||||
GossipSubGraftFloodThreshold = originalGossipSubGraftFloodThreshold
|
||||
GossipSubOpportunisticGraftTicks = originalGossipSubOpportunisticGraftTicks
|
||||
|
|
Loading…
Reference in New Issue