pbs_sched_subjob_badstate.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # coding: utf-8
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. # FOR A PARTICULAR PURPOSE.
  17. # See the GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # Commercial License Information:
  23. #
  24. # For a copy of the commercial license terms and conditions,
  25. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  26. # or contact the Altair Legal Department.
  27. #
  28. # Altair’s dual-license business model allows companies, individuals, and
  29. # organizations to create proprietary derivative works of PBS Pro and
  30. # distribute them - whether embedded or bundled with other software -
  31. # under a commercial license agreement.
  32. #
  33. # Use of Altair’s trademarks, including but not limited to "PBS™",
  34. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  35. # trademark licensing policies.
  36. from tests.functional import *
  37. class TestSchedSubjobBadstate(TestFunctional):
  38. @timeout('600')
  39. def test_sched_badstate_subjob(self):
  40. """
  41. This test case tests if scheduler goes into infinite loop
  42. when following conditions are met.
  43. - Kill a mom
  44. - mark the mom's state as free
  45. - submit an array job
  46. - check the sched log for "Leaving sched cycle" from the time
  47. array job was submitted.
  48. If we are unable to find a log match then scheduler is in
  49. endless loop and test case has failed.
  50. """
  51. self.mom.signal('-KILL')
  52. attr = {'state': 'free', 'resources_available.ncpus': '2'}
  53. self.server.manager(MGR_CMD_SET, NODE, attr, self.mom.shortname,
  54. expect=True)
  55. attr = {'scheduling': 'False'}
  56. self.server.manager(MGR_CMD_SET, SERVER, attr, expect=True)
  57. j1 = Job(TEST_USER)
  58. j1.set_attributes({'Resource_List.ncpus': '2', ATTR_J: '1-3'})
  59. j1id = self.server.submit(j1)
  60. now = time.time()
  61. attr = {'scheduling': 'True'}
  62. self.server.manager(MGR_CMD_SET, SERVER, attr, expect=True)
  63. self.scheduler.log_match("Leaving Scheduling Cycle",
  64. starttime=now,
  65. interval=1)
  66. self.server.delete(j1id)