Feature: Faster start & stop times (#648)

* Updates starting and stopping routines to be a bit more parallel with less waiting required

* Removes stop, removes debugging output

* linting and test fixes

* Add extra kill switch for exiting on exchange loading delay

* Fixes fun math

* breaks loop instead of switch. Moves param warns higher

* Removes unceccary gos. passes in cfg to remove data race

* Removes os signal processing. Fixes bad master merge
This commit is contained in:
Scott
2021-03-23 10:18:57 +11:00
committed by GitHub
parent 46f71952f9
commit 3c72a199f2
18 changed files with 209 additions and 200 deletions

View File

@@ -60,16 +60,16 @@ func TestGctScriptManagerStartStopNominal(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if mgr.started != 1 || mgr.stopped != 0 {
t.Errorf("Manager should be started (%v, %v)", mgr.started, mgr.stopped)
if mgr.started != 1 {
t.Errorf("Manager should be started (%v)", mgr.started)
}
err = mgr.Stop()
if err != nil {
t.Fatal(err)
}
wg.Wait()
if mgr.stopped != 0 {
t.Errorf("Manager should be stopped, expected=%v, got %v", 0, mgr.stopped)
if mgr.started != 0 {
t.Errorf("Manager should be stopped, expected=%v, got %v", 0, mgr.started)
}
}
@@ -77,7 +77,6 @@ func TestGctScriptManagerGetMaxVirtualMachines(t *testing.T) {
type fields struct {
config *Config
started int32
stopped int32
shutdown chan struct{}
MaxVirtualMachines *uint8
}
@@ -113,7 +112,6 @@ func TestGctScriptManagerGetMaxVirtualMachines(t *testing.T) {
g := &GctScriptManager{
config: tt.fields.config,
started: tt.fields.started,
stopped: tt.fields.stopped,
shutdown: tt.fields.shutdown,
MaxVirtualMachines: tt.fields.MaxVirtualMachines,
}