(t *testing.T)
| 549 | } |
| 550 | |
| 551 | func joinWhileVoteInProgress(t *testing.T) { |
| 552 | if docker.IsRunning() { |
| 553 | t.Skipf("skipping %s (docker is not supported)", t.Name()) |
| 554 | } |
| 555 | var ( |
| 556 | proxyURL = tutils.RandomProxyURL(t) |
| 557 | smap = tutils.GetClusterMap(t, proxyURL) |
| 558 | oldTargetCnt = smap.CountActiveTargets() |
| 559 | oldProxyCnt = smap.CountActiveProxies() |
| 560 | stopch = make(chan struct{}) |
| 561 | errCh = make(chan error, 10) |
| 562 | mocktgt = &voteRetryMockTarget{ |
| 563 | voteInProgress: true, |
| 564 | errCh: errCh, |
| 565 | } |
| 566 | ) |
| 567 | tlog.Logf("targets: %d, proxies: %d\n", oldTargetCnt, oldProxyCnt) |
| 568 | |
| 569 | go runMockTarget(t, proxyURL, mocktgt, stopch, smap) |
| 570 | |
| 571 | _, err := tutils.WaitForClusterState(proxyURL, "synchronize on 'new mock target'", |
| 572 | smap.Version, oldProxyCnt, oldTargetCnt+1) |
| 573 | tassert.CheckFatal(t, err) |
| 574 | |
| 575 | smap = killRestorePrimary(t, proxyURL, false, nil) |
| 576 | // |
| 577 | // FIXME: election is in progress if and only when xaction(apc.ActElection) is running - |
| 578 | // simulating the scenario via mocktgt.voteInProgress = true is incorrect |
| 579 | // |
| 580 | // if _, ok := smap.Pmap[oldPrimaryID]; ok { |
| 581 | // t.Fatalf("Previous primary proxy rejoined the cluster during a vote") |
| 582 | // } |
| 583 | mocktgt.voteInProgress = false |
| 584 | // smap, err = tutils.WaitForClusterState(newPrimaryURL, "synchronize new Smap", |
| 585 | // smap.Version, testing.Verbose(), oldProxyCnt, oldTargetCnt+1) |
| 586 | // tassert.CheckFatal(t, err) |
| 587 | // |
| 588 | // end of FIXME |
| 589 | |
| 590 | // time to kill the mock target, job well done |
| 591 | var v struct{} |
| 592 | stopch <- v |
| 593 | close(stopch) |
| 594 | select { |
| 595 | case err := <-errCh: |
| 596 | t.Errorf("Mock Target Error: %v", err) |
| 597 | |
| 598 | default: |
| 599 | } |
| 600 | |
| 601 | _, err = tutils.WaitForClusterState(smap.Primary.URL(cmn.NetPublic), |
| 602 | "to kill mock target", smap.Version, oldProxyCnt, oldTargetCnt) |
| 603 | tassert.CheckFatal(t, err) |
| 604 | } |
| 605 | |
| 606 | func minorityTargetMapVersionMismatch(t *testing.T) { |
| 607 | proxyURL := tutils.RandomProxyURL(t) |
nothing calls this directly
no test coverage detected