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

Refactor pantsd integration test framework #6508

Merged
merged 1 commit into from Sep 25, 2018

Conversation

Projects
None yet
4 participants
@blorente
Copy link
Contributor

blorente commented Sep 17, 2018

Problem

When running a pantsd in integration tests, the dependency between assert_started and assert_running is not clear to the developer.

Solution

Since we effectively use _pid as a flag to control whether or not we called assert_running, a solution is to call assert_started behind the scenes when we call assert_running before we should.

Since the new call to assert_started is dependent on a _pid being unset, it multiple calls to assert_running will be idempotent.

Result

A new helper function that does what assert_running did (to remove the call from assert_started to assert_running), and a modification to assert_running to call assert_started if the pid isn't there.

@stuhood
Copy link
Member

stuhood left a comment

Thanks. Will merge on green.

@baroquebobcat
Copy link
Contributor

baroquebobcat left a comment

👍

@stuhood

This comment has been minimized.

Copy link
Member

stuhood commented Sep 17, 2018

It looks like there is a hang in a pantsd test in Travis. To run an individual test method you can do:

./pants --owner-of='tests/python/pants_test/pantsd/test_pantsd_integration.py' test -- -k test_pantsd_filesystem_invalidation

And passing -s and/or -v to pytest can help as well:

./pants --owner-of='tests/python/pants_test/pantsd/test_pantsd_integration.py' test -- -s -v -k test_pantsd_filesystem_invalidation

@blorente blorente force-pushed the blorente:blorente/improve-test-pantsd-asserts branch from 496e71c to 8dc6a94 Sep 18, 2018

@blorente blorente force-pushed the blorente:blorente/improve-test-pantsd-asserts branch from 8dc6a94 to 0aa8f83 Sep 18, 2018

@illicitonion illicitonion merged commit f6cf76d into pantsbuild:master Sep 25, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@blorente blorente deleted the blorente:blorente/improve-test-pantsd-asserts branch Sep 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment