TritonDataCenter / sdc-cloudapi

Triton Data Center Public HTTP API
Mozilla Public License 2.0
10 stars 24 forks source link

Machines resize tests failing on COAL #95

Open marsell opened 3 years ago

marsell commented 3 years ago

On my COAL instance, the dimensions are insufficient to pass a particular test:

not ok 462 should be equal
  ---
    operator: equal
    expected: 1
    actual:   2
    at: parseResponse (/opt/smartdc/cloudapi/node_modules/restify/lib/clients/json_client.js:91:9)
    stack: |-
      Error: should be equal
          at Test.assert [as _assert] (/opt/smartdc/cloudapi/node_modules/tape/lib/test.js:228:54)
          at Test.bound [as _assert] (/opt/smartdc/cloudapi/node_modules/tape/lib/test.js:80:32)
          at Test.equal (/opt/smartdc/cloudapi/node_modules/tape/lib/test.js:389:10)
          at Test.bound (/opt/smartdc/cloudapi/node_modules/tape/lib/test.js:80:32)
          at /opt/smartdc/cloudapi/test/machines/resize.js:45:19
          at parseResponse (/opt/smartdc/cloudapi/node_modules/restify/lib/clients/json_client.js:91:9)
          at IncomingMessage.done (/opt/smartdc/cloudapi/node_modules/restify/lib/clients/string_client.js:167:13)
          at IncomingMessage.g (events.js:292:16)
          at emitNone (events.js:91:20)
          at IncomingMessage.emit (events.js:185:7)
  ...

The test is expected to fail due to server dimensions, except that in this case it's failing across two dimensions, not the expected one. In this case:

{ code: 'ValidationFailed',
  message: 'Invalid VM update parameters',
  errors:
   [ { field: 'ram',
       code: 'InsufficientCapacity',
       message: 'Required additional RAM (10239744) exceeds the server\'s available RAM (-34953)' },
     { field: 'quota',
       code: 'InsufficientCapacity',
       message: 'Required additional disk (99990) exceeds the server\'s available disk (-1015)' } ] }

The quota error is expected. The RAM is not. It should handle the latter case gracefully too.

marsell commented 3 years ago

Before: see above.

After:

[root@e5ad067e-ae5e-4505-933b-a31190be1489 (lab:cloudapi0) /opt/smartdc/cloudapi/test]# node machines.test.js
[...]
# teardown
ok 1612 teardown success

1..1612
# tests 1612
# pass  1612

# ok