Skip to content

Commit

Permalink
Fix pytest with multiprocess fail issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang2057 committed Apr 21, 2022
1 parent 0b3305d commit 71db9c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compiler-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
run: |
pytest -n 50 --dist=load tests/other --doctest-modules --junitxml=test_results/other.xml
pytest tests/importer --doctest-modules --junitxml=test_results/importer.xml
pytest -n 50 --dist=load tests/importer --doctest-modules --junitxml=test_results/importer.xml
pytest -n 50 --dist=load tests/schedule --doctest-modules --junitxml=test_results/schedule.xml
pytest -n 50 --dist=load tests/graph_partition --doctest-modules --junitxml=test_results/graph_partition.xml
pytest -n 50 --dist=load tests/transform --doctest-modules --junitxml=test_results/transform.xml
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/stackvm/ops/tensor.compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ result<void> stackvm_runtime_function::visit(const tensor_compare_op_t &op) noex
reinterpret_cast<bool *>(output), in_a_shape, in_a_strides, in_b_shape, in_b_strides, out_shape, out_strides);
break;
default:
std::cerr << "unsupported dtype for compare: " + std::string(datatype_names(op.datatype));
std::cerr << "unsupported dtype for compare: " + std::string(datatype_names(op.datatype)) << std::endl;
return err(std::errc::invalid_argument);
}
}
3 changes: 2 additions & 1 deletion tests/importer/onnx_/basic/test_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def _make_module(compare_op, in_type, in_shape_0, in_shape_1):
[[1, 1, 16, 16], [3, 3, 1, 16]],
]

@pytest.mark.parametrize('compare_op', compare_ops)
# pytest with multiprocess will fail on uppercase names
@pytest.mark.parametrize('compare_op', compare_ops, ids=['equal','greater','greater_or_equal','less','less_or_equal'])
@pytest.mark.parametrize('in_type', in_types)
@pytest.mark.parametrize('in_shape', in_shapes)
def test_compare(compare_op, in_type, in_shape, request):
Expand Down

0 comments on commit 71db9c9

Please sign in to comment.