-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
relative timing for unit tests (rebased) #60
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
Conversation
Current coverage is
|
d7d7b8b
to
7c50212
Compare
5e541cc
to
d250e27
Compare
This patch is complete for me. It's not perfect, but it's certainly more reliable than what we have now, so I think we can merge this until we get a better idea. |
can you check the failing tests @lrq3000 ? I've removed |
I will take a look, but why did you remove cputime? This was supposed to ensure that tqdm uses the relative timing if provided by unit tests (I know, that's not very elegant, but I have yet to find another way to do otherwise...). |
I removed it from the api and manually set it when unit testing :) |
e0f9ba7
to
096b678
Compare
I tried to investigate this issue for several hours now, and I cannot find the culprit. I cannot reproduce the issue locally, it seems it only happens on Travis, and using debug printing it seems that it's because of a low time resolution. As for the reasons why, I really don't know. The interesting thing is that this time resolution issue does not seem to happen when using the old way (with So I suggest we stay with |
Proof that it's a time resolution issue, but only when using clock():
Result:
The low time resolution completely put off all the tests based on rate variations. |
I'm trying another possible way to fix this issue. Please wait until then. |
I hereby declare: NO MORE OF THESE FREAKING TIMING ISSUES! (sorry about the caps, but these bugs were getting on my nerves ;) ). So, thank's to your great However, this idea is not implementable in Maybe todo:
|
@casperdcl What do you think about cputime? About simplifying some tests, we can maybe do that later, the tests run fine right now, this is not a need but just cosmetic :) Ah and I forgot to tell you that I have a weird issue since you added
(Sorry about the line wrap, damn Windows console...). Should we revert back? |
47d355f
to
835f9cc
Compare
Ok I'm crazy today, I'm gonna try to disassemble code on-the-fly to count the number of instructions and make a virtual timing environment for performances tests! |
Opcodes comparison is not yet ready, do not merge! The call is not recursive. I'm gonna try to fix that. |
whoa nice work Stephen. I didn't quite understand why this doesn't work for perf tests... |
Re: flake8 on windows, maybe open a new issue? I had changed to wildcards to stop recursive addition of directories. The new method requires less specification of individual file names (the old version would also fail by e.g. including non-timing tests in timed ones or vice-versa I think). |
@casperdcl Ok about opening an issue for flake8 on Windows, I'll do that when this PR will be merged. About For the moment, I have two main leads, all involving analysis of the bytecode opcodes:
|
For later: try to use |
[Redacted] |
7c9fe37
to
5af1135
Compare
I think it's time to merge this PR. We have a much better framework for time testing and perf testing, I think we should now merge into the main branch. I removed the bytecode opcode dynamic analysis and moved it into a new branch and PR #90, we'll see what we can do with that in the future. To summarize what has been done so far with this PR: In
In
|
@casperdcl and sorry about the messy history, please rebase as you want :) (ie, you can remove all commits related to bytecode analysis, and squash a few others together). |
@lrq3000 np messy histories are fine if they're just in branches :) will look at this later |
@casperdcl yes lol I noticed how great it is to use branches along a protected master. I think I'll do that with all my projects from now on! |
Signed-off-by: Stephen L. <lrq3000@gmail.com>
43371a3
to
d2411c7
Compare
…mock StringIO object + add hard perf tests Signed-off-by: Stephen L. <lrq3000@gmail.com>
a424b1c
to
20775cd
Compare
…tly works, else skip + Fix unit tests Signed-off-by: Stephen L. <lrq3000@gmail.com>
20775cd
to
8764f00
Compare
I rebased myself, since I better know the code changes of this PR. This PR should now be clean and ready for merge (I checked the changes commit by commit, useless code was removed such as the bytecode tracer). |
@casperdcl Should I proceed to the merging of this PR and of the IPython PR? I think they are both OK. |
@lrq3000 thanks, I'll look at them now you've finished. |
Ok thank's :) |
Conflicts: tqdm/_tqdm.py
relative timing for unit tests (rebased)
Should fix #59, #100 and #103 by using relative (cpu) timing (
time.process_time()
for Py3.3+ ortime.clock()
for Py2) instead of absolute timing (time.time()
). This should allow to reliably execute the unit tests that are time dependent, even if the Travis server is suddenly overloaded in the middle of a test.Signed-off-by: Stephen L. lrq3000@gmail.com