File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ import unittest
3+ from crate .qa .tests import NodeProvider , wait_for_active_shards
4+ from crate .client import connect
5+
6+
7+ class HotfixDowngradeTest (NodeProvider , unittest .TestCase ):
8+
9+ def test_latest_testing_can_be_downgraded_within_hotfix_versions (self ):
10+ cluster = self ._new_cluster ('latest-testing' , 2 )
11+ cluster .start ()
12+ node = cluster .node ()
13+ with connect (node .http_url , error_trace = True ) as conn :
14+ c = conn .cursor ()
15+ c .execute ('CREATE TABLE tbl (x int)' )
16+ c .execute ('INSERT INTO tbl (x) values (?)' , (10 ,))
17+ major , feature , hotfix = node .version
18+ for i in range (hotfix , 0 , - 1 ):
19+ new_version = (major , feature , i )
20+ with self .subTest (version = new_version ):
21+ node = self .upgrade_node (node , '.' .join (map (str , new_version )))
22+
23+ with connect (node .http_url , error_trace = True ) as conn :
24+ c = conn .cursor ()
25+ wait_for_active_shards (c )
26+ c .execute ('SELECT x FROM tbl' )
27+ xs = [row [0 ] for row in c .fetchall ()]
28+ self .assertEqual (xs , [10 ])
You can’t perform that action at this time.
0 commit comments