Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiqian committed Jul 26, 2024
1 parent b70c161 commit 59233f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tools/mig-test/datastream/run_migration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
require 'pathname'
require 'securerandom'

WAITING_SECONDS = 20
FLINK_HOME = ENV['FLINK_HOME']
throw 'Unspecified `FLINK_HOME` environment variable.' if FLINK_HOME.nil?
FLINK_HOME = Pathname.new(FLINK_HOME).realpath
Expand Down Expand Up @@ -58,7 +59,7 @@ def test_migration_chore(from_version, to_version)

random_string_1 = SecureRandom.hex(8)
put_mystery_data random_string_1
sleep 5
sleep WAITING_SECONDS
ensure_mystery_data random_string_1

puts `#{FLINK_HOME}/bin/flink stop --savepointPath #{Dir.pwd}/savepoints #{old_job_id}`
Expand All @@ -69,7 +70,7 @@ def test_migration_chore(from_version, to_version)
puts "Submitted job at #{to_version} as #{new_job_id}"
random_string_2 = SecureRandom.hex(8)
put_mystery_data random_string_2
sleep 10
sleep WAITING_SECONDS
ensure_mystery_data random_string_2
puts `#{FLINK_HOME}/bin/flink cancel #{new_job_id}`
true
Expand Down Expand Up @@ -130,6 +131,7 @@ def test_migration(from_version, to_version)
rescue LoadError
puts 'Test summary: ', printable_result
end
puts "✅ - Compatible, ❌ - Not compatible, ❓ - Target version doesn't support `--from-savepoint`"

if @failures.filter { |_, new_version| new_version == version_list.last }.any?
abort 'Some migration to snapshot version tests failed.'
Expand Down
5 changes: 3 additions & 2 deletions tools/mig-test/run_migration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
require 'pathname'
require 'securerandom'

WAITING_SECONDS = 20
FLINK_HOME = ENV['FLINK_HOME']
throw 'Unspecified `FLINK_HOME` environment variable.' if FLINK_HOME.nil?
FLINK_HOME = Pathname.new(FLINK_HOME).realpath
Expand Down Expand Up @@ -70,7 +71,7 @@ def test_migration_chore(from_version, to_version)
# Verify if data sync works
random_string_1 = SecureRandom.hex(8)
put_mystery_data random_string_1
sleep 5
sleep WAITING_SECONDS
ensure_mystery_data random_string_1

# Stop current job and create a savepoint
Expand All @@ -90,7 +91,7 @@ def test_migration_chore(from_version, to_version)
puts "Submitted job at #{to_version} as #{new_job_id}"
random_string_2 = SecureRandom.hex(8)
put_mystery_data random_string_2
sleep 10
sleep WAITING_SECONDS
ensure_mystery_data random_string_2
puts `#{FLINK_HOME}/bin/flink cancel #{new_job_id}`
true
Expand Down

0 comments on commit 59233f0

Please sign in to comment.