Development #43035
agent déploiement authentic et hobo.json modifié avec de l'info interne (?)
Début:
18 mai 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
On trouve dans un hobo.json enregistré dans le tenant d'authentic,
"services": [ { "$done": true, "service-id": "hobo", "title": "Hobo",
mais dans le code,
while retries < max_retries: for service in services: if service.get('$done'): continue ... loaded += 1 if len(services) == loaded: # it's finished no need to continue break # wait 5, 10, 20, 40, .. seconds time.sleep(self.backoff_factor * (2 ** retries))
résultat on se retrouve là à taper sur le time.sleep() parce que tout est à $done mais loaded est ne monte jamais. (???)
taper ça :
- loaded = 0 + loaded = len([x for x in services if x.get('$done')])
?
Fichiers
Révisions associées
misc: do not wait already deployed SP (#43035)
Historique
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Fichier 0002-misc-do-not-wait-already-deployed-SP-43035.patch 0002-misc-do-not-wait-already-deployed-SP-43035.patch ajouté
- Fichier 0001-tests_authentic2-verify-calls-to-sleep-on-redeploy-4.patch 0001-tests_authentic2-verify-calls-to-sleep-on-redeploy-4.patch ajouté
- Tracker changé de Support à Development
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
tox -e py2-authentic -- tests_authentic -k hobo_deploy
Avant :
with mock.patch('hobo.agent.authentic2.provisionning.notify_agents') as mock_notify, \ mock.patch('hobo.agent.authentic2.management.commands.hobo_deploy.sleep', wraps=time.sleep) as sleep_mock: call_command('hobo_deploy', redeploy=True) > assert sleep_mock.call_count == 0 E AssertionError: assert 1 == 0 E + where 1 = <MagicMock name='sleep' id='140186694722640'>.call_count tests_authentic/test_hobo_deploy.py:468: AssertionError
Après :
collected 9 items / 7 deselected / 2 selected tests_authentic/test_hobo_deploy.py ..
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
Branche modifiée :
- j'ai viré
loaded
qui ne sert plus, - et j'ai rajouté un check sur le nombre d'appels à
sleep
lors du premier hobo_deploy.
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 0a476f2b33d43fa4a2068b2210afcb5ae2ad82ad Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Mon May 18 20:42:20 2020 +0200 misc: do not wait already deployed SP (#43035) commit bad0618e160cd1283cc25958aa7edce93e21768f Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Mon May 18 20:36:00 2020 +0200 tests_authentic2: verify calls to sleep() on redeploy (#43035)
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
tests_authentic2: verify calls to sleep() on redeploy (#43035)