Merge pull request #112660 from turion/dev_test_vscodium
tests/vscodium: Fix race condition
This commit is contained in:
commit
4a22f8aa88
1 changed files with 3 additions and 18 deletions
|
@ -29,33 +29,18 @@ import ./make-test-python.nix ({ pkgs, ...} :
|
||||||
start_all()
|
start_all()
|
||||||
machine.wait_for_x()
|
machine.wait_for_x()
|
||||||
|
|
||||||
# Create a file that we'll open
|
# Start VSCodium with a file that doesn't exist yet
|
||||||
machine.succeed("su - alice -c 'echo \" Hello World\" > foo.txt'")
|
machine.fail("ls /home/alice/foo.txt")
|
||||||
|
|
||||||
# It's one line long
|
|
||||||
assert "1 foo.txt" in machine.succeed(
|
|
||||||
"su - alice -c 'wc foo.txt -l'"
|
|
||||||
), "File has wrong length"
|
|
||||||
|
|
||||||
# Start VSCodium with that file
|
|
||||||
machine.succeed("su - alice -c 'codium foo.txt' &")
|
machine.succeed("su - alice -c 'codium foo.txt' &")
|
||||||
|
|
||||||
# Wait for the window to appear
|
# Wait for the window to appear
|
||||||
machine.wait_for_text("VSCodium")
|
machine.wait_for_text("VSCodium")
|
||||||
|
|
||||||
# Add a line
|
|
||||||
machine.send_key("ret")
|
|
||||||
|
|
||||||
# Save file
|
# Save file
|
||||||
machine.send_key("ctrl-s")
|
machine.send_key("ctrl-s")
|
||||||
|
|
||||||
# Wait until the file has been saved
|
# Wait until the file has been saved
|
||||||
machine.sleep(1)
|
machine.wait_for_file("/home/alice/foo.txt")
|
||||||
|
|
||||||
# Now the file is 2 lines long
|
|
||||||
assert "2 foo.txt" in machine.succeed(
|
|
||||||
"su - alice -c 'wc foo.txt -l'"
|
|
||||||
), "File has wrong length"
|
|
||||||
|
|
||||||
machine.screenshot("VSCodium")
|
machine.screenshot("VSCodium")
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue