Bug 21238 - TemplateToolkit.t is failing on slow server
Summary: TemplateToolkit.t is failing on slow server
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-16 15:29 UTC by Jonathan Druart
Modified: 2018-09-21 13:13 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers (1.67 KB, patch)
2018-08-16 15:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers (1.73 KB, patch)
2018-08-16 15:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers (1.73 KB, patch)
2018-08-16 20:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers (1.73 KB, patch)
2018-08-16 20:05 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-08-16 15:29:32 UTC
It failed 3x in the last 6 runs (on node 1), we should mock DateTime->now to prevent it to fail again.
Comment 1 Jonathan Druart 2018-08-16 15:32:46 UTC
Created attachment 77934 [details] [review]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers

It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!
Comment 2 Martin Renvoize 2018-08-16 15:40:32 UTC
Created attachment 77935 [details] [review]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers

It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2018-08-16 15:41:47 UTC
Sensible fix, works as expected. Signing Off
Comment 4 Katrin Fischer 2018-08-16 20:04:59 UTC
Created attachment 77958 [details] [review]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers

It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Katrin Fischer 2018-08-16 20:05:36 UTC
Created attachment 77959 [details] [review]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers

It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Nick Clemens 2018-08-21 13:58:09 UTC
Awesome work all!

Pushed to master for 18.11
Comment 7 Martin Renvoize 2018-08-24 09:01:23 UTC
Pushed to 18.05.x for 18.05.03, thanks Jonathan!
Comment 8 Fridolin SOMERS 2018-09-21 13:13:28 UTC
Pushed to 17.11.x for 17.11.10