Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
b22332fd
Commit
b22332fd
authored
Apr 20, 2021
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Remove tests of no longer existing funcitons
parent
e472274f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
network/gateway/hostpool_test.go
+0
-100
0 additions, 100 deletions
network/gateway/hostpool_test.go
with
0 additions
and
100 deletions
network/gateway/hostpool_test.go
+
0
−
100
View file @
b22332fd
...
@@ -395,106 +395,6 @@ func TestHostPool_CheckReplace(t *testing.T) {
...
@@ -395,106 +395,6 @@ func TestHostPool_CheckReplace(t *testing.T) {
}
}
// TODO: Adapt to new methods
// Happy path
//func TestHostPool_PruneHostPool(t *testing.T) {
// manager := newMockManager()
// testNdf := getTestNdf(t)
// newIndex := uint32(20)
// params := DefaultPoolParams()
// params.PoolSize = uint32(len(testNdf.Gateways))
// rng := csprng.NewSystemRNG()
//
// // Construct a manager (bypass business logic in constructor)
// hostPool := &HostPool{
// manager: manager,
// hostList: make([]*connect.Host, newIndex+1),
// hostMap: make(map[id.ID]uint32),
// ndf: testNdf,
// poolParams: params,
// rng: rng,
// }
//
// // Pull all gateways from ndf into host manager
// hostList := make([]*connect.Host, 0)
// for _, gw := range testNdf.Gateways {
//
// gwId, err := id.Unmarshal(gw.ID)
// if err != nil {
// t.Errorf("Failed to unmarshal ID in mock ndf: %v", err)
// }
// // Add mock gateway to manager
// h, err := manager.AddHost(gwId, "", nil, connect.GetDefaultHostParams())
// if err != nil {
// t.Errorf("Could not add mock host to manager: %v", err)
// t.FailNow()
// }
//
// hostList = append(hostList, h)
//
// }
//
// // Construct a host past the error threshold
// errorThresholdIndex := 0
// overThreshold := params.ErrThreshold + 25
// hostList[errorThresholdIndex].SetMetricsTesting(connect.NewMetricTesting(overThreshold, t), t)
// oldHost := hostList[0]
//
// // Call prune host pool
// err := hostPool.pruneHostPool()
// if err != nil {
// t.Errorf("Unexpected error in happy path: %v", err)
// }
//
// // Check that the host map has been properly updated
// for _, h := range hostList {
// _, ok := hostPool.hostMap[*h.GetId()]
// if !ok {
// t.Errorf("Gateway %s was not placed in host map after pruning", h.GetId().String())
// }
// }
//
// // Check that the host list has been has been properly updated
// // at the index with a host past the error threshold
// retrievedHost := hostPool.hostList[errorThresholdIndex]
// if reflect.DeepEqual(oldHost, retrievedHost) {
// t.Errorf("Expected host list to have it's bad host replaced. " +
// "Contains old host information after pruning")
// }
//
//}
//
//// Error path: not enough gateways in ndf compared to
//// required pool size
//func TestHostPool_PruneHostPool_Error(t *testing.T) {
// manager := newMockManager()
// testNdf := getTestNdf(t)
// newIndex := uint32(20)
// params := DefaultPoolParams()
//
// // Trigger the case where the Ndf doesn't have enough gateways
// params.PoolSize = uint32(len(testNdf.Gateways)) + 1
// rng := csprng.NewSystemRNG()
//
// // Construct a manager (bypass business logic in constructor)
// hostPool := &HostPool{
// manager: manager,
// hostList: make([]*connect.Host, newIndex+1),
// hostMap: make(map[id.ID]uint32),
// ndf: testNdf,
// poolParams: params,
// rng: rng,
// }
//
// // Call prune
// err := hostPool.pruneHostPool()
// if err == nil {
// t.Errorf("Gateways should not be available: " +
// "not enough gateways in ndf compared to param's pool size")
// }
//
//}
// Unit test
// Unit test
func
TestHostPool_UpdateNdf
(
t
*
testing
.
T
)
{
func
TestHostPool_UpdateNdf
(
t
*
testing
.
T
)
{
manager
:=
newMockManager
()
manager
:=
newMockManager
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment