diff --git a/gql_test.go b/gql_test.go index 2478b08..8670575 100644 --- a/gql_test.go +++ b/gql_test.go @@ -9,7 +9,7 @@ import ( func TestGQLThread(t * testing.T) { ctx := logTestContext(t, []string{}) - gql_thread, err := NewGQLThread(ctx, ":8080", []Lockable{}) + gql_thread, err := NewGQLThread(ctx, ":0", []Lockable{}) fatalErr(t, err) test_thread_1, err := NewSimpleThread(ctx, "Test thread 1", []Lockable{}, BaseThreadActions, BaseThreadHandlers) @@ -28,10 +28,11 @@ func TestGQLThread(t * testing.T) { go func(thread Thread){ time.Sleep(10*time.Millisecond) - err = UseStates(ctx, []GraphNode{thread}, func(states NodeStateMap) error { + err := UseStates(ctx, []GraphNode{thread}, func(states NodeStateMap) error { SendUpdate(ctx, thread, CancelSignal(nil), states) return nil }) + fatalErr(t, err) }(gql_thread) err = RunThread(ctx, gql_thread, "start") @@ -47,7 +48,7 @@ func TestGQLDBLoad(t * testing.T) { fatalErr(t, err) update_channel := t1.UpdateChannel(10) - gql, err := NewGQLThread(ctx, ":8080", []Lockable{l1}) + gql, err := NewGQLThread(ctx, ":0", []Lockable{l1}) fatalErr(t, err) info := NewGQLThreadInfo(true, "start", "restore") diff --git a/lockable_test.go b/lockable_test.go index 3de88d5..b1e15d8 100644 --- a/lockable_test.go +++ b/lockable_test.go @@ -271,12 +271,12 @@ func TestLockableLockTieredConflict(t * testing.T) { } func TestLockableSimpleUpdate(t * testing.T) { - ctx := testContext(t) + ctx := logTestContext(t, []string{"test", "update", "lockable"}) l1, err := NewSimpleLockable(ctx, "Test Lockable 1", []Lockable{}) fatalErr(t, err) - update_channel := l1.UpdateChannel(0) + update_channel := l1.UpdateChannel(1) go func() { UseStates(ctx, []GraphNode{l1}, func(states NodeStateMap) error { @@ -289,7 +289,7 @@ func TestLockableSimpleUpdate(t * testing.T) { } func TestLockableDownUpdate(t * testing.T) { - ctx := testContext(t) + ctx := logTestContext(t, []string{"test", "update", "lockable"}) l1, err := NewSimpleLockable(ctx, "Test Lockable 1", []Lockable{}) fatalErr(t, err) @@ -300,7 +300,7 @@ func TestLockableDownUpdate(t * testing.T) { _, err = NewSimpleLockable(ctx, "Test Lockable 3", []Lockable{l2}) fatalErr(t, err) - update_channel := l1.UpdateChannel(0) + update_channel := l1.UpdateChannel(1) go func() { UseStates(ctx, []GraphNode{l2}, func(states NodeStateMap) error { @@ -313,7 +313,7 @@ func TestLockableDownUpdate(t * testing.T) { } func TestLockableUpUpdate(t * testing.T) { - ctx := logTestContext(t, []string{"test", "update"}) + ctx := logTestContext(t, []string{"test", "update", "lockable"}) l1, err := NewSimpleLockable(ctx, "Test Lockable 1", []Lockable{}) fatalErr(t, err) @@ -324,7 +324,7 @@ func TestLockableUpUpdate(t * testing.T) { l3, err := NewSimpleLockable(ctx, "Test Lockable 3", []Lockable{l2}) fatalErr(t, err) - update_channel := l3.UpdateChannel(0) + update_channel := l3.UpdateChannel(1) go func() { UseStates(ctx, []GraphNode{l2}, func(states NodeStateMap) error { @@ -337,7 +337,7 @@ func TestLockableUpUpdate(t * testing.T) { } func TestOwnerNotUpdatedTwice(t * testing.T) { - ctx := testContext(t) + ctx := logTestContext(t, []string{"test", "update", "lockable"}) l1, err := NewSimpleLockable(ctx, "Test Lockable 1", []Lockable{}) fatalErr(t, err) @@ -345,7 +345,7 @@ func TestOwnerNotUpdatedTwice(t * testing.T) { l2, err := NewSimpleLockable(ctx, "Test Lockable 2", []Lockable{l1}) fatalErr(t, err) - update_channel := l2.UpdateChannel(0) + update_channel := l2.UpdateChannel(1) go func() { UseStates(ctx, []GraphNode{l1}, func(states NodeStateMap) error {