Skip to content

Commit

Permalink
engine: add test for parallel bots (thrasher-corp#609)
Browse files Browse the repository at this point in the history
* enable a no longer failing test
  • Loading branch information
Rots authored Dec 23, 2020
1 parent 622e5dc commit 752d621
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ func TestLoadConfigWithSettings(t *testing.T) {
}

func TestStartStopDoesNotCausePanic(t *testing.T) {
t.Skip("Due to race condition with global config.Cfg being used from multiple tests and RPC server and REST proxy never properly stopped when engine.Stop() is called")
t.Parallel()
botOne, err := NewFromSettings(&Settings{
ConfigFile: config.TestFile,
EnableDryRun: true,
}, make(map[string]bool))
}, nil)
if err != nil {
t.Error(err)
}
Expand All @@ -88,3 +88,31 @@ func TestStartStopDoesNotCausePanic(t *testing.T) {

botOne.Stop()
}

func TestStartStopTwoDoesNotCausePanic(t *testing.T) {
t.Skip("Closing global currency.storage from two bots causes panic")
t.Parallel()
botOne, err := NewFromSettings(&Settings{
ConfigFile: config.TestFile,
EnableDryRun: true,
}, nil)
if err != nil {
t.Error(err)
}
botTwo, err := NewFromSettings(&Settings{
ConfigFile: config.TestFile,
EnableDryRun: true,
}, nil)
if err != nil {
t.Error(err)
}
if err = botOne.Start(); err != nil {
t.Error(err)
}
if err = botTwo.Start(); err != nil {
t.Error(err)
}

botOne.Stop()
botTwo.Stop()
}

0 comments on commit 752d621

Please sign in to comment.