Closed dongsupark closed 7 years ago
Fixed bugs.
checkSystemdActiveState()
retrieve unit state after sleeps, to avoid occasional errors from assertion of active states.getSingleUnitState()
to simplify the logic in checkSystemdActiveState()
.inmemoryRegistry.UnitState()
as well as rpcserver.GetUnitState()
. Without these, grpc-enabled tests cannot work at all. It was my fault to have missed these methods. :-(cAPI.UnitState()
. Due to dependency chain through protobuf, however, I cannot manage to make this PR work on the older version of gRPC & protobuf.My suggestion is to merge first https://github.com/coreos/fleet/pull/1673 and https://github.com/coreos/fleet/pull/1667. After that, we could take some time to review this PR for cAPI.UnitState()
.
Anyway every functional test should now work as expected. :-)
Added necesssary unit tests too.
should I hold off until #1667 #1673 before taking a look?
@jonboulle Yes. I think we should first have a look into https://github.com/coreos/fleet/pull/1673 and https://github.com/coreos/fleet/pull/1667 to merge those PRs.
Rebased on top of master, which already includes https://github.com/coreos/fleet/pull/1667. So this PR depends only on https://github.com/coreos/fleet/pull/1673.
I managed to get this PR decoupled from #1673. Now it's working even without updating gRPC altogether.
At the beginning it didn't work with old gRPC, because for some reason the new method GetUnitState()
was introduced only to RegistryClient
interface, but not to RegistryServer
. That's why gRPC connections failed with messages like "unknown method GetUnitState"
. With GetUnitState()
included in RegistryServer
interface, it's working fine.
It's ready for review.
Although it contains many lines of codes, I think its logic is relatively straightforward. I'm going to merge it in the next week.
A couple of questions about the fleetctl code, but overall this looks really great, thanks!
Rebased, and pushed 2 more commits, "fleetctl: periodically check for systemd states using waitForState" and "fleetctl: make use of waitForState also in assertUnitState()". I came up with an idea of making use of waitForState, just like that in functional tests. Now the ugly sleeps can be removed.
I suppose everything was addressed. I'm merging it. In case of any other issues, feel free to comment. Nitpicking is also welcome. :-) I would then create another PR to fix it.
GET
method forstateResource
Get
method forUnitState
UnitState()
for API interfaceGetUnitState()
for registryClient and registryServerUnitState()
foretcdRegistry
andRPCRegistry
cAPI.UnitStates()
with.UnitState()
GetUnitState()
and relevant oneswaitForState
waitForState
also inassertUnitState()
Fixes https://github.com/coreos/fleet/issues/1675