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

Wrong duration time (sometimes) calculated #226

Closed
sagatowski opened this issue Nov 28, 2023 · 8 comments · Fixed by #227
Closed

Wrong duration time (sometimes) calculated #226

sagatowski opened this issue Nov 28, 2023 · 8 comments · Fixed by #227
Assignees
Labels
bug Something isn't working

Comments

@sagatowski
Copy link
Member

Describe the bug
Sometimes the duration/time is wrongly calculated. This happens completely randomly and I have not been able to see why or any patterns. See screenshot below.

To Reproduce
Run tests over and over again. Eventually it will show up.

Screenshots
image

Software versions
Current master of TcUnit.
XAE 3.1.4024.50.
TcXaeShell.

Run environment
Virtual machine.

@stefanbesler

@sagatowski sagatowski added the bug Something isn't working label Nov 28, 2023
@sagatowski sagatowski changed the title Wrong time (sometimes) calculated Wrong duration time (sometimes) calculated Nov 28, 2023
@sagatowski
Copy link
Member Author

image

@stefanbesler
Copy link
Contributor

stefanbesler commented Nov 30, 2023

Sorry, I am a bit busy at the moment, I can look into this somewhen next week.

Since this is so sporadic and the duration is off by such a large value, I think it has to do with this here

F_GetCpuCounterAs64bit := SHL(32, DWORD_TO_LWORD(CpuCounter.cpuCntHiDW)) + DWORD_TO_LWORD(CpuCounter.cpuCntLoDW);]]></ST>

This should most likely be

SHL(DWORD_TO_LWORD(CpuCounter.cpuCntHiDW), 32)

@TimSalzmann
Copy link

Can you give me a hint? I run TcUnit verifier 1.2.1.0 hand have 118 faild test is that correct? I want to simulate the random error.
image

@sagatowski
Copy link
Member Author

@TimSalzmann

The expected behaviour is documented here:
https://github.com/tcunit/TcUnit/tree/master/TcUnit-Verifier

So to answer your question:

private static int expectedNumberOfFailedTests = 118; // Update this if you add intentionally failing tests

@stefanbesler
Copy link
Contributor

Could reproduce it and solved it in the PR

@sagatowski
Copy link
Member Author

Re-opening issue as the test-duration is still not calculated correctly for TEST_ORDERED(). See more details here:

Keeping this open until this issue is fully resolved to remember to close this for TcUnit 1.3.1.

@stefanbesler
Copy link
Contributor

Maybe just revert the feature. I am not using TcUnit with ordered tests and I don’t have an example to debug the issue, it’s kinda hard for me to fix this, also I feels like ages since I worked on this. For a long time I am even mocking everything that is time dependent out of my tests to have all of them finish in 1 cyclic

@sagatowski
Copy link
Member Author

Solved in #231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants