Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-11048

Add tests that shows how to delete config values with Mutation API

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      There are no tests that really show how to delete configs via the Mutation API.
      I discovered that null values coming in the global conf update of the SchedConfUpdateInfo DTO class will be translated to an action that deletes the config from the Configuration object.
      The request field of this global config map is called "global-updates" and the corresponding code is here.

      See the code fragment of MutableCSConfigurationProvider that deletes the configuration: here

      A good candidate class would be: TestRMWebServicesConfigurationMutation.
      Here, we can add a testcase that does some Node label related API actions, as when deleting node labels and de-assigning the capacities from labels and queues, some residual config will stay in the Configuration object, so it's easy to show what's going on and how to get rid of those configs.
      The testcase should perform the following:

      1. Create a node label by calling the "add-node-labels" endpoint.
      2. Verify that the node label is created by calling the "get-node-labels" endpoint
      3. Assign some queues to the new label
      4. Set partition capacities to queues
      5. Verify if the capacities are applied to the partitions.
      6. De-assign node label from the queues + remove the residual configs by sending empty strings or null values. Basically, this is inverting the configs set by step 3.
      7. Remove the node label
      8. Check if the residual configs are in the Configuration object. They shouldn't be in it.

      Attachments

        Issue Links

          Activity

            People

              snemeth Szilard Nemeth
              snemeth Szilard Nemeth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m