(t *testing.T)
| 609 | } |
| 610 | |
| 611 | func TestSubscribeSyncRace(t *testing.T) { |
| 612 | s := RunServerOnPort(TEST_PORT) |
| 613 | defer s.Shutdown() |
| 614 | |
| 615 | nc, err := nats.Connect(fmt.Sprintf("127.0.0.1:%d", TEST_PORT)) |
| 616 | if err != nil { |
| 617 | t.Fatalf("Error on connect: %v", err) |
| 618 | } |
| 619 | defer nc.Close() |
| 620 | |
| 621 | go func() { |
| 622 | time.Sleep(time.Millisecond) |
| 623 | nc.Close() |
| 624 | }() |
| 625 | |
| 626 | subj := "foo.sync.race" |
| 627 | for i := 0; i < 10000; i++ { |
| 628 | if _, err := nc.SubscribeSync(subj); err != nil { |
| 629 | break |
| 630 | } |
| 631 | if _, err := nc.QueueSubscribeSync(subj, "gc"); err != nil { |
| 632 | break |
| 633 | } |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | func TestBadSubjectsAndQueueNames(t *testing.T) { |
| 638 | s := RunServerOnPort(TEST_PORT) |
nothing calls this directly
no test coverage detected