-
Notifications
You must be signed in to change notification settings - Fork 893
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
Fixes for 2.12.x #6159
Merged
Merged
Fixes for 2.12.x #6159
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The current version of the BGW scheduler mock does not support multiple background workers. If a second worker was registered, the reference to the previously registered worker gets lost. So, the implementation of the mock scheduler only waits for the latest registered worker before updating the mocked current time, which causes a race condition. If the previous workers are still active and logging messages after this point, the messages are logged with the updated mocked time. This leads to a non-deterministic behavior and test failures. For example: msg_no | mock_time | application_name | msg ---------+-----------+-------------------------+---------------------- - 1 | 0 | Retention Policy [1002] | job 1002 [...] [...] + 1 | 1000000 | Retention Policy [1002] | job 1002 [...] (cherry picked from commit abf79f4)
The regression test bgw_db_scheduler tests if the BGW scheduler starts a background job after it is created. However, this only happens if the previous instance of the BGW scheduler is no longer active. If the old BGW scheduler instance is still running, it will pick up the job and prevent it from starting in the current test. (cherry picked from commit ebaee6c)
This patch stops the background worker in the bgw_launcher test teardown before the database is dropped. The current version of the test is flaky because sometimes the database cannot be dropped due to BGW activity. (cherry picked from commit 14e275a)
One of the test cases changes chunk status in order to fail the background job in order to ensure jobs continue to be scheduled even after such a scenario. The problem lies in the race condition between compression policy and the status update which both update the catalog and that causes random test failures. The solution is to add the compression policy after updating the status, eliminating the possibility of race condition. (cherry picked from commit 5cdd414)
The bgw_launcher test changes the tablespace for a database. However, this requires that the database is used and no BGW are accessing the database. This PR ensures that the background workers are stopped before the tablespace is changed. (cherry picked from commit d9e4a71)
Isolation test `cagg_insert` is flaky because refresh steps can complete in any order. Adding constraints so that completion is reported in the same order in all test runs. Fixes timescale#5331 (cherry picked from commit 6bef59a)
When dropping a table, we get notices if that causes to cancel background jobs and thus fail tests. By stopping the workers before dropping the table, we should reduce this flakiness. (cherry picked from commit 6e4d174)
Codecov Report
@@ Coverage Diff @@
## 2.12.x #6159 +/- ##
=========================================
Coverage ? 81.53%
=========================================
Files ? 246
Lines ? 56771
Branches ? 12576
=========================================
Hits ? 46288
Misses ? 8081
Partials ? 2402 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disable-check: force-changelog-file