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

Intermittent test failure #19

Closed
whosgonna opened this issue Dec 19, 2016 · 2 comments
Closed

Intermittent test failure #19

whosgonna opened this issue Dec 19, 2016 · 2 comments

Comments

@whosgonna
Copy link
Owner

The following failure is intermittently observed in test 02_apiinfo.version.t:

#   Failed test 'Still able to retrieve version after login. (No auth parameter sent)'
#   at t/02_apiinfo.version.t line 106.
# died: malformed number (leading zero must not be followed by another digit), at character offset 40 (before "492714094}") at /usr/home/ben/Zabbix-Tiny/.build/77f9lV9s/blib/lib/Zabbix/Tiny.pm line 141.

Will look into this before pushing to CPAN.

@whosgonna
Copy link
Owner Author

Quick guess:
The id is set as a random string of numbers, thus on one out of ten attempts, the leading digit should be a zero. It looks like the problem is the JSON module is treating this as a number, rather than a string, which is failing to encode when the leading number is a zero.

I had originally mis-read the JSON-RPC specification, and thought that the ID was supposed to be random. On a re-read, this appears to be incorrect, and they should be sequential. Currently, I'm re-generating the id with each prepare, so the id should be a tracked property. I think a hotfix is needed for the current encoding problem, and rectifying the id to a non-random number will need to be a separate (slightly larger) fix.

@whosgonna
Copy link
Owner Author

Fixed in 387859c. ID now increments sequentially.

whosgonna pushed a commit that referenced this issue Apr 30, 2017
Changelog diff is:

diff --git a/Changes b/Changes
index 54c6b93..521c844 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,10 @@ Revision history for Perl extension Zabbix-Tiny

 {{$NEXT}}

+1.09 2017-04-30T02:30:34Z
+    - GitHub Issue #17 - Empty response from the API not handled properly
+    - GetHub Issue #19 - Intermittent test failure
+
 1.07 2016-08-11T18:43:07Z

     - GitHub Issue #15 - Using Modern::Perl instead of strict and warnings in tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant