Fix DbaHistoryControllerTest failures caused by DBID contamination in shared ClientInfoStore#30
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job test_19_10-ee_PDB
Fix DbaHistoryControllerTest failures caused by DBID contamination in shared ClientInfoStore
Jun 2, 2026
This file contains hidden or 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
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.
CI job
test_19_10-ee_PDB / test (dp)fails inDbaHistoryControllerTestwithRuntimeError: Parameter 'dbid' required but not givenon multiple actions (list_sql_history_snapshots,list_sysmetric_historic,list_sys_time_model_historic,list_system_statistics_historic,show_using_sqls_historic,list_awr_report_html).Root Cause
The CI environment runs two Oracle databases:
localhost:1553/ORCLPDB1— PDB, AWR DBID2890944461(correct test target)localhost:1941/ORCL— separate CDB, DBID1525389775All integration tests share
client_key=100in theFileStore-backedClientInfoStoresingleton.StorageControllerTest.test_exadataandPanoramaSamplerControllerTest.test_save_configboth connect to the CDB atlocalhost:1941/ORCL, writingchosen_dbid=1525389775into the shared store.DbaHistoryControllerTestsetup callsset_cached_dbid(2890944461)to correct this, butset_cached_dbidperforms a non-atomic read-modify-write:Under JRuby's true multi-threading, a concurrent background write (sampler or connection cleanup thread) can race between the read and write, leaving
chosen_dbid=1525389775ornilin the store. The controller then reads the wrong/nil DBID andprepare_param_dbidraises.Proposed Fix
Pass
dbid: @dbidexplicitly in the affected test POST requests.@dbidis reliably set by the fallback loop ininitialize_min_max_snap_id_and_timesand is not subject to theClientInfoStorerace. Affected requests:list_sql_history_snapshotsshow_using_sqls_historiclist_system_statistics_historiclist_sysmetric_historiclist_system_time_model_historiclist_awr_report_html