Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: make time type string [s ns] #662

Merged
merged 3 commits into from
Aug 16, 2021
Merged

Conversation

FirefoxMetzger
Copy link
Contributor

@FirefoxMetzger FirefoxMetzger commented Aug 10, 2021

🦟 Bug fix

Fixes #642

Summary

While I did this in #643 I think it makes sense to make it a separate PR and rebase. This way this bug can be fixed while awaiting feedback for different things in the other PR.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

@github-actions github-actions bot added the 🏢 edifice Ignition Edifice label Aug 10, 2021
@FirefoxMetzger
Copy link
Contributor Author

FirefoxMetzger commented Aug 10, 2021

This is such an odd failure. double_pendulum.sdf doesn't even use a state element and by extension neither a time element, which is the only one I touched.

The log seems to agree with me (full log below)

103: http://sdformat.org/schemas/sensor.xsd:19: element include: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}include': Failed to load the document 'http://sdformat.org/schemas/rfidtag.xsd' for inclusion.

@chapulina Is this a known flakey test, or do you have any idea what could be going on?

Full Test Log ``` test 103 Start 103: INTEGRATION_schema_test

103: Test command: /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/build/test/integration/INTEGRATION_schema_test "--gtest_output=xml:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/build/test_results/INTEGRATION_schema_test.xml"
103: Environment variables:
103: SDF_PATH=/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.8:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.7:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.6:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.5:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.4:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.3:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.2:/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/sdf/1.0:
103: Test timeout computed to be: 240
103: Running main() from gtest_main.cc
103: [==========] Running 3 tests from 1 test case.
103: [----------] Global test environment set-up.
103: [----------] 3 tests from SDFSchemaGenerator
103: [ RUN ] SDFSchemaGenerator.TestDoublePendulum
103: error : Operation in progress
103: warning: failed to load external entity "http://sdformat.org/schemas/rfidtag.xsd"
103: http://sdformat.org/schemas/sensor.xsd:19: element include: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}include': Failed to load the document 'http://sdformat.org/schemas/rfidtag.xsd' for inclusion.
103: WXS schema /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/build/sdf/1.8/root.xsd failed to compile
103: CMD[xmllint --noout --schema /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/build/sdf/1.8/root.xsd /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/test/integration/model/double_pendulum.sdf]
103: /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/test/integration/schema_test.cc:52: Failure
103: Failed
103: Fail in parsing the model
103: [ FAILED ] SDFSchemaGenerator.TestDoublePendulum (62365 ms)
103: [ RUN ] SDFSchemaGenerator.TestPR2Model
103: /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/test/integration/model/pr2.sdf validates
103: CMD[xmllint --noout --schema /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/build/sdf/1.8/root.xsd /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/test/integration/model/pr2.sdf]
103: [ OK ] SDFSchemaGenerator.TestPR2Model (3036 ms)
103: [ RUN ] SDFSchemaGenerator.TestTurtleBotModel
103: /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/test/integration/model/turtlebot.sdf validates
103: CMD[xmllint --noout --schema /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/build/sdf/1.8/root.xsd /Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64/sdformat/test/integration/model/turtlebot.sdf]
103: [ OK ] SDFSchemaGenerator.TestTurtleBotModel (2949 ms)
103: [----------] 3 tests from SDFSchemaGenerator (68350 ms total)
103:
103: [----------] Global test environment tear-down
103: [==========] 3 tests from 1 test case ran. (68350 ms total)
103: [ PASSED ] 2 tests.
103: [ FAILED ] 1 test, listed below:
103: [ FAILED ] SDFSchemaGenerator.TestDoublePendulum
103:
103: 1 FAILED TEST
103/216 Test #103: INTEGRATION_schema_test ................................***Failed 68.36 sec

</details>

@chapulina
Copy link
Contributor

humm strange failure, only on macOS. There aren't known flakes for this branch and platform, that's why we set the check as Required.

Issues on macOS could be due to different dependency versions... Sometimes it's a clang vs gcc thing, or a timing issue (because our macOS CI machines are slow), but I don't think it could be those here.

@FirefoxMetzger
Copy link
Contributor Author

Okay. It could indeed be a timeout, considering that the test took ~ 1 minute to fail for such a simple thing (running xmllint should take ms, right?). I'm not a Jenkins user myself, but is the setup included in this time? If not, this could be further evidence for a timeout.

Copy link
Collaborator

@jennuine jennuine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Just a quick comment

@@ -31,7 +31,8 @@
</xsd:simpleType>

<xsd:simpleType name="time">
<xsd:restriction base="xsd:double">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d+ \d+"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update the others as well

Suggested change
<xsd:pattern value="\d+ \d+"/>
<xsd:pattern value="\s*\d+\s+\d+\s*"/>

Copy link
Contributor Author

@FirefoxMetzger FirefoxMetzger Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jennuine Hm, if we are worried about whitespace, wouldn't something like this be a bit more readable?

<xsd:restriction base="xsd:string">
  <xsd:whiteSpace value="collapse"/>
  <xsd:pattern value="\d+ \d+"/>
</xsd:restriction>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jennuine Done.

@jennuine jennuine merged commit 5a8e796 into gazebosim:sdf11 Aug 16, 2021
@FirefoxMetzger FirefoxMetzger deleted the fix-time branch August 17, 2021 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏢 edifice Ignition Edifice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid default value for elements of type <time>
3 participants