engine: add test for parallel bots (#609)

* enable a no longer failing test
This commit is contained in:
Rauno Ots
2020-12-23 03:10:32 +01:00
committed by GitHub
parent 622e5dc8c8
commit 752d62133d

View File

@@ -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)
}
@@ -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()
}