a little bit more time to avoid races with restoring mutated config variables

This commit is contained in:
vyzo 2020-04-22 20:05:33 +03:00
parent 37e1a81100
commit a50deb04c0
2 changed files with 4 additions and 4 deletions

View File

@ -321,7 +321,7 @@ func TestGossipsubAttackGRAFTDuringBackoff(t *testing.T) {
originalGossipSubPruneBackoffPenalty := GossipSubPruneBackoffPenalty
GossipSubPruneBackoffPenalty = 500 * time.Millisecond
defer func() {
time.Sleep(time.Second)
time.Sleep(time.Second + 100*time.Millisecond)
GossipSubPruneBackoff = originalGossipSubPruneBackoff
GossipSubPruneBackoffPenalty = originalGossipSubPruneBackoffPenalty
GossipSubGraftFloodThreshold = originalGossipSubGraftFloodThreshold

View File

@ -272,7 +272,7 @@ func TestGossipsubFanoutMaintenance(t *testing.T) {
func TestGossipsubFanoutExpiry(t *testing.T) {
GossipSubFanoutTTL = 1 * time.Second
defer func() {
time.Sleep(time.Second)
time.Sleep(time.Second + 100*time.Millisecond)
GossipSubFanoutTTL = 60 * time.Second
}()
@ -1000,7 +1000,7 @@ func TestGossipsubDirectPeers(t *testing.T) {
originalGossipSubDirectConnectTicks := GossipSubDirectConnectTicks
GossipSubDirectConnectTicks = 2
defer func() {
time.Sleep(time.Second)
time.Sleep(time.Second + 100*time.Millisecond)
GossipSubDirectConnectTicks = originalGossipSubDirectConnectTicks
}()
@ -1286,7 +1286,7 @@ func TestGossipsubOpportunisticGrafting(t *testing.T) {
originalGossipSubOpportunisticGraftTicks := GossipSubOpportunisticGraftTicks
GossipSubOpportunisticGraftTicks = 2
defer func() {
time.Sleep(time.Second)
time.Sleep(time.Second + 100*time.Millisecond)
GossipSubPruneBackoff = originalGossipSubPruneBackoff
GossipSubGraftFloodThreshold = originalGossipSubGraftFloodThreshold
GossipSubOpportunisticGraftTicks = originalGossipSubOpportunisticGraftTicks