Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Docker CPU integration test improvements
Browse files Browse the repository at this point in the history
Adjusted assertions for RAM and CPU.
Marked tests as slow for they are such (>5s each).

Signed-off-by: Adam Wierzbicki <awierzbicki@golem.network>
  • Loading branch information
Wiezzel committed Nov 29, 2019
1 parent 589ec56 commit a3dc979
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/golem/envs/docker/cpu/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


@ci_skip
@pytest.mark.slow
class TestIntegration(TestCase, DatabaseFixture):

@classmethod
Expand Down Expand Up @@ -172,7 +173,8 @@ def test_memory_counter(self):
max_ram = runtime.usage_counter_values().ram_max_bytes
self.assertLessEqual(avg_ram, max_ram)
self.assertGreater(max_ram, num_bytes)
self.assertLess(max_ram, 2 * num_bytes)
# Upper bound is very loose because it is highly unpredictable
self.assertLess(max_ram, 10 * num_bytes)
finally:
yield runtime.clean_up()

Expand All @@ -196,5 +198,7 @@ def test_cpu_counter(self):
self.assertApproximates(
(cpu_user + cpu_kernel), cpu_total, 0.1 * sec_ns)
self.assertGreater(cpu_total, 0.9 * seconds * sec_ns)
# Upper bound is very loose because it is highly unpredictable
self.assertLess(cpu_total, 10 * seconds * sec_ns)
finally:
yield runtime.clean_up()

0 comments on commit a3dc979

Please # to comment.