rancher / tasks

1 stars 1 forks source link

TFs from test_kontainer_drivers.py #132

Open mrajashree opened 5 years ago

mrajashree commented 5 years ago

5 tests from this file have failed in drone a few times, for example in this build https://drone-publish.rancher.io/rancher/rancher/117/1/2


=================================== FAILURES ===================================
--
9367 | _______________________ test_kontainer_driver_lifecycle ________________________
9368 |  
9369 | admin_mc = <core.conftest.ManagementContext object at 0x7f68aaf7cc18>
9370 | remove_resource = <function remove_resource.<locals>._cleanup at 0x7f68ab1c18c8>
9371 |  
9372 | @pytest.mark.nonparallel
9373 | def test_kontainer_driver_lifecycle(admin_mc, remove_resource):
9374 | kd = admin_mc.client.create_kontainerDriver(
9375 | createDynamicSchema=True,
9376 | active=True,
9377 | url=DRIVER_URL
9378 | )
9379 | remove_resource(kd)
9380 |  
9381 | # Test that it is in downloading state while downloading
9382 | kd = wait_for_condition('Downloaded', 'Unknown', admin_mc.client, kd)
9383 | assert "downloading" == kd.state
9384 |  
9385 | # no actions should be present while downloading/installing
9386 | assert not hasattr(kd, 'actions')
9387 |  
9388 | # test driver goes active and appears in schema
9389 | kd = wait_for_condition('Active', 'True', admin_mc.client, kd,
9390 | > timeout=90)
9391 |  
9392 | test_kontainer_drivers.py:53:
9393 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9394 |  
9395 | condition_type = 'Active', status = 'True'
9396 | client = <rancher.Client object at 0x7f68ab1cc898>
9397 | obj = {'active': True, 'actualUrl': 'https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kon...xample/releases/download/v0.2.1/kontainer-engine-driver-example-linux', 'uuid': 'c28febc3-4106-11e9-9ee9-0242ac110003'}
9398 | timeout = 90
9399 |  
9400 | def wait_for_condition(condition_type, status, client, obj, timeout=45):
9401 | start = time.time()
9402 | obj = client.reload(obj)
9403 | sleep = 0.01
9404 | while not find_condition(condition_type, status, obj):
9405 | time.sleep(sleep)
9406 | sleep *= 2
9407 | if sleep > 2:
9408 | sleep = 2
9409 | obj = client.reload(obj)
9410 | delta = time.time() - start
9411 | if delta > timeout:
9412 | msg = 'Timeout waiting for [{}:{}] for condition after {}' \
9413 | ' seconds'.format(obj.type, obj.id, delta)
9414 | > raise Exception(msg)
9415 | E Exception: Timeout waiting for [kontainerDriver:kd-mgpqn] for condition after 90.78965187072754 seconds
9416 |  
9417 | conftest.py:339: Exception
9418 | _____________________ test_enabling_driver_exposes_schema ______________________
9419 |  
9420 | admin_mc = <core.conftest.ManagementContext object at 0x7f68aaf7cc18>
9421 | wait_remove_resource = <function wait_remove_resource.<locals>._cleanup at 0x7f68a84de400>
9422 |  
9423 | @pytest.mark.nonparallel
9424 | def test_enabling_driver_exposes_schema(admin_mc, wait_remove_resource):
9425 | """ Test if enabling driver exposes its dynamic schema, drivers are
9426 | downloaded / installed once they are active """
9427 | kd = admin_mc.client.create_kontainerDriver(
9428 | createDynamicSchema=True,
9429 | active=False,
9430 | > url=DRIVER_URL
9431 | )
9432 |  
9433 | test_kontainer_drivers.py:80:
9434 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9435 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:552: in _cb
9436 | return method(type_name, *args, **kw)
9437 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:462: in create
9438 | return self._post(collection_url, data=self._to_dict(*args, **kw))
9439 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:68: in wrapped
9440 | return fn(*args, **kw)
9441 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:319: in _post
9442 | self._error(r.text)
9443 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9444 |  
9445 | self = <rancher.Client object at 0x7f68ab1cc898>
9446 | text = '{"baseType":"error","code":"Conflict","message":"Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux","status":409,"type":"error"}\n'
9447 |  
9448 | def _error(self, text):
9449 | > raise ApiError(self._unmarshall(text))
9450 | E rancher.ApiError: (ApiError(...), "Conflict : Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux\n\t{'baseType': 'error', 'code': 'Conflict', 'message': 'Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux', 'status': 409, 'type': 'error'}")
9451 |  
9452 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:299: ApiError
9453 | _________________________ test_upgrade_changes_schema __________________________
9454 |  
9455 | admin_mc = <core.conftest.ManagementContext object at 0x7f68aaf7cc18>
9456 | wait_remove_resource = <function wait_remove_resource.<locals>._cleanup at 0x7f68a84de7b8>
9457 |  
9458 | @pytest.mark.nonparallel
9459 | def test_upgrade_changes_schema(admin_mc, wait_remove_resource):
9460 | client = admin_mc.client
9461 | kd = client.create_kontainerDriver(
9462 | createDynamicSchema=True,
9463 | active=True,
9464 | > url=DRIVER_URL
9465 | )
9466 |  
9467 | test_kontainer_drivers.py:114:
9468 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9469 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:552: in _cb
9470 | return method(type_name, *args, **kw)
9471 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:462: in create
9472 | return self._post(collection_url, data=self._to_dict(*args, **kw))
9473 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:68: in wrapped
9474 | return fn(*args, **kw)
9475 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:319: in _post
9476 | self._error(r.text)
9477 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9478 |  
9479 | self = <rancher.Client object at 0x7f68ab1cc898>
9480 | text = '{"baseType":"error","code":"Conflict","message":"Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux","status":409,"type":"error"}\n'
9481 |  
9482 | def _error(self, text):
9483 | > raise ApiError(self._unmarshall(text))
9484 | E rancher.ApiError: (ApiError(...), "Conflict : Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux\n\t{'baseType': 'error', 'code': 'Conflict', 'message': 'Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux', 'status': 409, 'type': 'error'}")
9485 |  
9486 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:299: ApiError
9487 | ____________________ test_create_duplicate_driver_conflict _____________________
9488 |  
9489 | admin_mc = <core.conftest.ManagementContext object at 0x7f68aaf7cc18>
9490 | wait_remove_resource = <function wait_remove_resource.<locals>._cleanup at 0x7f68aaf4f158>
9491 |  
9492 | @pytest.mark.nonparallel
9493 | def test_create_duplicate_driver_conflict(admin_mc, wait_remove_resource):
9494 | """ Test if adding a driver with a pre-existing driver's URL
9495 | returns a conflict error"""
9496 | kd = admin_mc.client.create_kontainerDriver(
9497 | createDynamicSchema=True,
9498 | active=True,
9499 | > url=DRIVER_URL
9500 | )
9501 |  
9502 | test_kontainer_drivers.py:146:
9503 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9504 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:552: in _cb
9505 | return method(type_name, *args, **kw)
9506 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:462: in create
9507 | return self._post(collection_url, data=self._to_dict(*args, **kw))
9508 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:68: in wrapped
9509 | return fn(*args, **kw)
9510 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:319: in _post
9511 | self._error(r.text)
9512 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9513 |  
9514 | self = <rancher.Client object at 0x7f68ab1cc898>
9515 | text = '{"baseType":"error","code":"Conflict","message":"Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux","status":409,"type":"error"}\n'
9516 |  
9517 | def _error(self, text):
9518 | > raise ApiError(self._unmarshall(text))
9519 | E rancher.ApiError: (ApiError(...), "Conflict : Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux\n\t{'baseType': 'error', 'code': 'Conflict', 'message': 'Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux', 'status': 409, 'type': 'error'}")
9520 |  
9521 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:299: ApiError
9522 | ____________________ test_update_duplicate_driver_conflict _____________________
9523 |  
9524 | admin_mc = <core.conftest.ManagementContext object at 0x7f68aaf7cc18>
9525 | wait_remove_resource = <function wait_remove_resource.<locals>._cleanup at 0x7f68acf970d0>
9526 |  
9527 | @pytest.mark.nonparallel
9528 | def test_update_duplicate_driver_conflict(admin_mc, wait_remove_resource):
9529 | """ Test if updating a driver's URL to a pre-existing driver's URL
9530 | returns a conflict error"""
9531 | kd1 = admin_mc.client.create_kontainerDriver(
9532 | createDynamicSchema=True,
9533 | active=True,
9534 | > url=DRIVER_URL
9535 | )
9536 |  
9537 | test_kontainer_drivers.py:171:
9538 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9539 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:552: in _cb
9540 | return method(type_name, *args, **kw)
9541 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:462: in create
9542 | return self._post(collection_url, data=self._to_dict(*args, **kw))
9543 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:68: in wrapped
9544 | return fn(*args, **kw)
9545 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:319: in _post
9546 | self._error(r.text)
9547 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9548 |  
9549 | self = <rancher.Client object at 0x7f68ab1cc898>
9550 | text = '{"baseType":"error","code":"Conflict","message":"Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux","status":409,"type":"error"}\n'
9551 |  
9552 | def _error(self, text):
9553 | > raise ApiError(self._unmarshall(text))
9554 | E rancher.ApiError: (ApiError(...), "Conflict : Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux\n\t{'baseType': 'error', 'code': 'Conflict', 'message': 'Driver URL already in use: https://github.com/rancher/kontainer-engine-driver-example/releases/download/v0.2.1/kontainer-engine-driver-example-linux', 'status': 409, 'type': 'error'}")
9555 |  
9556 | ../.tox/py37/lib/python3.7/site-packages/rancher.py:299: ApiError
daxmc99 commented 5 years ago

Looks like test_kontainerlifecycle failed and did not clean up causing the cascading failures. Also see https://github.com/rancher/rancher/pull/18463 There is not enough information in the logs to debug this fully.

cbron commented 5 years ago

Appears this is still happening: https://drone-pr.rancher.io/rancher/rancher/4081/2/2 edit: this ^ one has total failures, so maybe not entirely related.