hudl / fargo

Golang client for Netflix Eureka
MIT License
133 stars 53 forks source link

Supply the set of instances for a VIP address #54

Closed seh closed 7 years ago

seh commented 8 years ago

Per the preceding discussion in #53, synchronously retrieve the instances registered with a given secure or insecure VIP address, optionally filtering and shuffling them too. This is a first step ("polling"), deferring the "consuming" and "caching" facilities for a subsequent patch.

Note that writing the code under test took a day or two, but writing the tests has been a month-long pursuit. It's not difficult to figure out how to exercise the new capabilities; what's painfully frustrating is trying to accommodate Euereka's replication and cache eviction delays.

Here are the concessions I've tried:

The proposal here includes that final, remorseful hack: wait for an amount of time that seems to work often enough, where waiting any less works less reliably. It's the only one I could get to work. I am open to other ideas if this one is sufficiently distasteful.

Since two of these new tests take so long to run, I skip them when testing.Short is true (summoned via go test -short). We might consider adding this short v. long sensitivity to other long-running test functions.