yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

extra_test.go: Add test timeout multiplier environment variable #337

Closed piggynl closed 1 year ago

piggynl commented 1 year ago

Hi,

Currently some performance tests in extra_test.go are failing in low-performance environments (QEMU user mode emulation in my case).

=== RUN   TestDeepNestedLabelPerformance
    extra_test.go:112: Parsing deep nested labels took more 5 secs
--- FAIL: TestDeepNestedLabelPerformance (25.33s)
=== RUN   TestManyProcessingInstructionPerformance
    extra_test.go:132: Parsing processing instructions took more 5 secs
--- FAIL: TestManyProcessingInstructionPerformance (14.11s)
=== RUN   TestManyCDATAPerformance
    extra_test.go:152: Parsing processing instructions took more 5 secs
--- FAIL: TestManyCDATAPerformance (33.70s)
=== RUN   TestManyDeclPerformance
    extra_test.go:172: Parsing processing instructions took more 5 secs
--- FAIL: TestManyDeclPerformance (16.28s)
=== RUN   TestManyCommentPerformance
    extra_test.go:192: Parsing processing instructions took more 5 secs
--- FAIL: TestManyCommentPerformance (40.88s)

I think reading a timeout multiplier from environment variable is a reasonable way to test goldmark in those low-performance environments without affecting the tests in normal environments.

Thank you for looking into this PR!

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.